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

Method Wait

library/cpp/yt/threading/count_down_latch.cpp:37–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void TCountDownLatch::Wait() const
38{
39 while (true) {
40#ifndef _linux_
41 TGuard<TMutex> guard(Mutex_);
42#endif
43 auto count = Count_.load(std::memory_order::acquire);
44 if (count == 0) {
45 return;
46 }
47#ifdef _linux_
48 int rv = NThreading::FutexWait(
49 const_cast<int*>(reinterpret_cast<const int*>(&Count_)),
50 count);
51 YT_VERIFY(rv >= 0 || errno == EWOULDBLOCK || errno == EINTR);
52#else
53 ConditionVariable_.WaitI(Mutex_);
54#endif
55 }
56}
57
58bool TCountDownLatch::TryWait() const
59{

Callers

nothing calls this directly

Calls 3

FutexWaitFunction · 0.85
loadMethod · 0.45
WaitIMethod · 0.45

Tested by

no test coverage detected