MCPcopy Create free account
hub / github.com/facebook/CacheLib / wakeupBatonSet

Function wakeupBatonSet

cachelib/common/inject_pause.cpp:48–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48size_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

Callers 2

injectPauseWaitFunction · 0.85
injectPauseClearFunction · 0.85

Calls 3

postMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected