| 550 | } |
| 551 | |
| 552 | void shutdown() override { |
| 553 | // Stop all worker threads... |
| 554 | { |
| 555 | std::unique_lock<std::mutex> lock(mutex_); |
| 556 | shutdown_ = true; |
| 557 | } |
| 558 | |
| 559 | cond_.notify_all(); |
| 560 | |
| 561 | // Join... |
| 562 | for (auto &t : threads_) { |
| 563 | t.join(); |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | private: |
| 568 | struct worker { |