| 49 | { |
| 50 | public: |
| 51 | Impl(size_t size, TFinishRoutineFn const & finishFn) : m_finishFn(finishFn), m_threads(size) |
| 52 | { |
| 53 | ASSERT_GREATER(size, 0, ()); |
| 54 | for (auto & thread : m_threads) |
| 55 | { |
| 56 | thread = std::make_unique<threads::Thread>(); |
| 57 | thread->Create(std::make_unique<PoolRoutine>(std::bind(&Impl::PopFront, this), m_finishFn)); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | ~Impl() { Stop(); } |
| 62 |