| 46 | } |
| 47 | |
| 48 | size_t wakeupBatonSet(BatonSet& batonSet, size_t numThreads) { |
| 49 | size_t numWaked = 0; |
| 50 | if (numThreads == 0) { |
| 51 | numThreads = batonSet.batons.size(); |
| 52 | } |
| 53 | |
| 54 | while (!batonSet.batons.empty() && numWaked < numThreads) { |
| 55 | auto* b = batonSet.batons.front(); |
| 56 | batonSet.batons.pop_front(); |
| 57 | b->post(); |
| 58 | numWaked++; |
| 59 | } |
| 60 | |
| 61 | return numWaked; |
| 62 | } |
| 63 | |
| 64 | } // namespace |
| 65 |
no test coverage detected