Signal the cv if this is the last group
| 86 | } |
| 87 | // Signal the cv if this is the last group |
| 88 | TaskScheduler::TaskGroupContinuationImpl MakeFinalContinuation( |
| 89 | std::atomic<int>* counter, std::mutex* mutex, std::condition_variable* finish) { |
| 90 | return [=](std::size_t thread_id) { |
| 91 | if (counter->fetch_sub(1) == 1) { |
| 92 | std::lock_guard<std::mutex> lg(*mutex); |
| 93 | finish->notify_one(); |
| 94 | } |
| 95 | return Status::OK(); |
| 96 | }; |
| 97 | } |
| 98 | |
| 99 | // This test simulates one of the current use patterns of the |
| 100 | // task scheduler. There are a number of groups. The groups |