* @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. */
| 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 |
nothing calls this directly
no test coverage detected