| 12 | { |
| 13 | |
| 14 | class ThreadPool |
| 15 | { |
| 16 | public: |
| 17 | typedef std::function<void(threads::IRoutine *)> TFinishRoutineFn; |
| 18 | |
| 19 | ThreadPool(size_t size, TFinishRoutineFn const & finishFn); |
| 20 | ~ThreadPool(); |
| 21 | |
| 22 | // ThreadPool will not delete routine. You can delete it in TFinishRoutineFn. |
| 23 | void PushBack(threads::IRoutine * routine); |
| 24 | void PushFront(threads::IRoutine * routine); |
| 25 | |
| 26 | // - calls Cancel for the current processing routines |
| 27 | // - joins threads |
| 28 | // - calls Cancel for the remains routines in queue |
| 29 | void Stop(); |
| 30 | |
| 31 | private: |
| 32 | class Impl; |
| 33 | Impl * m_impl; |
| 34 | }; |
| 35 | |
| 36 | } // namespace base |
no outgoing calls
no test coverage detected