| 14 | } // namespace |
| 15 | |
| 16 | UNIT_TEST(ThreadPoolComputational_SomeThreads) |
| 17 | { |
| 18 | for (size_t t = 0; t < kTimes; ++t) |
| 19 | { |
| 20 | size_t const threadCount = 4; |
| 21 | std::atomic<size_t> counter{0}; |
| 22 | { |
| 23 | base::ComputationalThreadPool threadPool(threadCount); |
| 24 | for (size_t i = 0; i < threadCount; ++i) |
| 25 | { |
| 26 | threadPool.Submit([&]() |
| 27 | { |
| 28 | threads::Sleep(1); |
| 29 | ++counter; |
| 30 | }); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | TEST_EQUAL(threadCount, counter, ()); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | UNIT_TEST(ThreadPoolComputational_OneThread) |
| 39 | { |