MCPcopy Create free account
hub / github.com/abess-team/abess / Push

Method Push

python/include/unsupported/test/cxx11_eventcount.cpp:49–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 ~TestQueue() { VERIFY_IS_EQUAL(val_.load(), 0); }
48
49 bool Push() {
50 int val = val_.load(std::memory_order_relaxed);
51 for (;;) {
52 VERIFY_GE(val, 0);
53 VERIFY_LE(val, kQueueSize);
54 if (val == kQueueSize) return false;
55 if (val_.compare_exchange_weak(val, val + 1, std::memory_order_relaxed))
56 return true;
57 }
58 }
59
60 bool Pop() {
61 int val = val_.load(std::memory_order_relaxed);

Callers 1

test_stress_eventcountFunction · 0.80

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected