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

Function ~thread_pool

include/BS_thread_pool.hpp:1495–1511  ·  view source on GitHub ↗

* @brief Destruct the thread pool. Waits for all tasks to complete, then destroys all threads. If a cleanup function was set, it will run in each thread right before it is destroyed. Note that if the pool is paused, then any tasks still in the queue will never be executed. */

Source from the content-addressed store, hash-verified

1493 * @brief Destruct the thread pool. Waits for all tasks to complete, then destroys all threads. If a cleanup function was set, it will run in each thread right before it is destroyed. Note that if the pool is paused, then any tasks still in the queue will never be executed.
1494 */
1495 ~thread_pool() noexcept
1496 {
1497#ifdef __cpp_exceptions
1498 try
1499 {
1500#endif
1501 wait();
1502#ifndef __cpp_lib_jthread
1503 destroy_threads();
1504#endif
1505#ifdef __cpp_exceptions
1506 }
1507 catch (...)
1508 {
1509 }
1510#endif
1511 }
1512
1513 // =======================
1514 // Public member functions

Callers

nothing calls this directly

Calls 2

waitFunction · 0.85
destroy_threadsFunction · 0.85

Tested by

no test coverage detected