| 34 | } // namespace |
| 35 | |
| 36 | UNIT_TEST(ThreadPool_CanceledTaskTest) |
| 37 | { |
| 38 | int finishCounter = 0; |
| 39 | Condition cond; |
| 40 | base::ThreadPool pool(4, |
| 41 | std::bind(&JoinFinishFunction, std::placeholders::_1, std::ref(finishCounter), std::ref(cond))); |
| 42 | |
| 43 | for (int i = 0; i < TASK_COUNT; ++i) |
| 44 | pool.PushBack(new CanceledTask()); |
| 45 | |
| 46 | pool.Stop(); |
| 47 | |
| 48 | TEST_EQUAL(finishCounter, TASK_COUNT, ()); |
| 49 | } |
| 50 | |
| 51 | namespace |
| 52 | { |