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

Method CountDown

library/cpp/yt/threading/count_down_latch.cpp:19–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17{ }
18
19void TCountDownLatch::CountDown()
20{
21#ifndef _linux_
22 TGuard<TMutex> guard(Mutex_);
23#endif
24 auto previous = Count_.fetch_sub(1, std::memory_order::release);
25 if (previous == 1) {
26#ifdef _linux_
27 int rv = NThreading::FutexWake(
28 reinterpret_cast<int*>(&Count_),
29 std::numeric_limits<int>::max());
30 YT_VERIFY(rv >= 0);
31#else
32 ConditionVariable_.BroadCast();
33#endif
34 }
35}
36
37void TCountDownLatch::Wait() const
38{

Callers

nothing calls this directly

Calls 4

FutexWakeFunction · 0.85
maxFunction · 0.50
fetch_subMethod · 0.45
BroadCastMethod · 0.45

Tested by

no test coverage detected