| 144 | .valueOr(glm::max(std::thread::hardware_concurrency() - 1, 2u))) {} |
| 145 | |
| 146 | AThreadPool::~AThreadPool() { |
| 147 | std::unique_lock lck(mQueueLock); |
| 148 | auto workers = std::move(mWorkers); |
| 149 | for (auto& f : workers) { |
| 150 | f->aboutToDelete(); |
| 151 | } |
| 152 | |
| 153 | mCV.notify_all(); |
| 154 | lck.unlock(); |
| 155 | |
| 156 | for (auto& f : workers) { |
| 157 | f->join(); |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | void AThreadPool::setWorkersCount(std::size_t workersCount) { |
| 162 | AUI_ASSERTX(workersCount >= 2 && workersCount <= 1000, "invalid worker count"); |
nothing calls this directly
no test coverage detected