| 625 | } |
| 626 | |
| 627 | void ThreadPool::CollectFinishedWorkersUnlocked() { |
| 628 | for (auto& thread : state_->finished_workers_) { |
| 629 | // Make sure OS thread has exited |
| 630 | thread.join(); |
| 631 | } |
| 632 | state_->finished_workers_.clear(); |
| 633 | } |
| 634 | |
| 635 | // MinGW's __emutls implementation for C++ thread_local has known race conditions |
| 636 | // during thread creation. When a new worker thread is spawned and immediately |