| 775 | } |
| 776 | |
| 777 | void shutdown() override { |
| 778 | // Stop all worker threads... |
| 779 | { |
| 780 | std::unique_lock<std::mutex> lock(mutex_); |
| 781 | shutdown_ = true; |
| 782 | } |
| 783 | |
| 784 | cond_.notify_all(); |
| 785 | |
| 786 | // Join... |
| 787 | for (auto &t : threads_) { |
| 788 | t.join(); |
| 789 | } |
| 790 | } |
| 791 | |
| 792 | private: |
| 793 | struct worker { |