MCPcopy Create free account
hub / github.com/catboost/catboost / Arrive

Method Arrive

library/cpp/threading/future/future_mt_ut.cpp:35–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 }
34
35 void Arrive() {
36 // barrier is not for synchronization, just to ensure good timings, so
37 // std::memory_order_relaxed is enough
38 Waiting_.fetch_add(-1, std::memory_order_relaxed);
39
40 while (Waiting_.load(std::memory_order_relaxed)) {
41 }
42
43 Y_ASSERT(Waiting_.load(std::memory_order_relaxed) >= 0);
44 }
45
46 private:
47 std::atomic<i64> Waiting_;

Callers 1

RunWaitTestFunction · 0.80

Calls 2

fetch_addMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected