| 610 | } |
| 611 | |
| 612 | void shutdown() override { |
| 613 | // Stop all worker threads... |
| 614 | { |
| 615 | std::unique_lock<std::mutex> lock(mutex_); |
| 616 | shutdown_ = true; |
| 617 | } |
| 618 | |
| 619 | cond_.notify_all(); |
| 620 | |
| 621 | // Join... |
| 622 | for (auto &t : threads_) { |
| 623 | t.join(); |
| 624 | } |
| 625 | } |
| 626 | |
| 627 | private: |
| 628 | struct worker { |