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

Function reset

include/BS_thread_pool.hpp:1744–1747  ·  view source on GitHub ↗

* @brief Reset the pool with the default number of threads (as if constructed with the default constructor). Waits for all tasks to be completed, both running and queued, then destroys the thread pool and creates a new one with an empty task queue. If pausing is enabled, only waits for tasks that are currently running before destroying the pool; once the pool is reset, it will then resume executin

Source from the content-addressed store, hash-verified

1742 * @brief Reset the pool with the default number of threads (as if constructed with the default constructor). Waits for all tasks to be completed, both running and queued, then destroys the thread pool and creates a new one with an empty task queue. If pausing is enabled, only waits for tasks that are currently running before destroying the pool; once the pool is reset, it will then resume executing the tasks that remained in the queue and any newly submitted tasks. If the pool was paused before resetting it, the new pool will be paused as well.
1743 */
1744 void reset()
1745 {
1746 reset(0, [](std::size_t) {});
1747 }
1748
1749 /**
1750 * @brief Reset the pool with a new number of threads. Waits for all tasks to be completed, both running and queued, then destroys the thread pool and creates a new one with an empty task queue. If pausing is enabled, only waits for tasks that are currently running before destroying the pool; once the pool is reset, it will then resume executing the tasks that remained in the queue and any newly submitted tasks. If the pool was paused before resetting it, the new pool will be paused as well.

Callers

nothing calls this directly

Calls 1

reset_poolFunction · 0.85

Tested by

no test coverage detected