| 12 | // ---------------------------------------------------------------------------------------- |
| 13 | |
| 14 | thread_pool_implementation:: |
| 15 | thread_pool_implementation ( |
| 16 | unsigned long num_threads |
| 17 | ) : |
| 18 | task_done_signaler(m), |
| 19 | task_ready_signaler(m), |
| 20 | we_are_destructing(false) |
| 21 | { |
| 22 | tasks.resize(num_threads); |
| 23 | threads.resize(num_threads); |
| 24 | for (unsigned long i = 0; i < num_threads; ++i) |
| 25 | { |
| 26 | threads[i] = std::thread([&](){this->thread();}); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | // ---------------------------------------------------------------------------------------- |
| 31 | |