| 589 | class ThreadPool : public TaskQueue { |
| 590 | public: |
| 591 | explicit ThreadPool(size_t n) : shutdown_(false) { |
| 592 | while (n) { |
| 593 | threads_.emplace_back(worker(*this)); |
| 594 | n--; |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | ThreadPool(const ThreadPool &) = delete; |
| 599 | ~ThreadPool() override = default; |