| 601 | } |
| 602 | |
| 603 | void shutdown() override { |
| 604 | // Stop all worker threads... |
| 605 | { |
| 606 | std::unique_lock<std::mutex> lock(mutex_); |
| 607 | shutdown_ = true; |
| 608 | } |
| 609 | |
| 610 | cond_.notify_all(); |
| 611 | |
| 612 | // Join... |
| 613 | for (auto &t : threads_) { |
| 614 | t.join(); |
| 615 | } |
| 616 | } |
| 617 | |
| 618 | private: |
| 619 | struct worker { |