| 56 | } |
| 57 | |
| 58 | ThreadPool::~ThreadPool() |
| 59 | { |
| 60 | WaitForTasks(); |
| 61 | |
| 62 | m_terminate.store(true); |
| 63 | |
| 64 | m_forward.notify_all(); |
| 65 | |
| 66 | for (std::thread& thread : m_threads) |
| 67 | thread.join(); |
| 68 | } |
| 69 | |
| 70 | void ThreadPool::AddTask(std::shared_ptr<ThreadPoolTask> const& task) |
| 71 | { |
nothing calls this directly
no outgoing calls
no test coverage detected