MCPcopy Create free account
hub / github.com/bshoshany/thread-pool / pop_task

Function pop_task

include/BS_thread_pool.hpp:2251–2260  ·  view source on GitHub ↗

* @brief Pop a task from the queue. * * @return The task. */

Source from the content-addressed store, hash-verified

2249 * @return The task.
2250 */
2251 [[nodiscard]] task_t pop_task()
2252 {
2253 task_t task;
2254 if constexpr (priority_enabled)
2255 task = std::move(tasks.top().task);
2256 else
2257 task = std::move(tasks.front());
2258 tasks.pop();
2259 return task;
2260 }
2261
2262 /**
2263 * @brief Reset the pool with a new number of threads and a new initialization function. This member function implements the actual reset, while the public member function `reset()` also handles the case where the pool is paused.

Callers 1

workerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected