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

Method WaitD

util/system/condvar.cpp:97–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 }
96
97 inline bool WaitD(TMutex& lock, TInstant deadLine) noexcept {
98 if (deadLine == TInstant::Max()) {
99 int ret = pthread_cond_wait(&Cond_, (pthread_mutex_t*)lock.Handle());
100 Y_ABORT_UNLESS(ret == 0, "pthread_cond_wait failed: %s", LastSystemErrorText(ret));
101 return true;
102 } else {
103 struct timespec spec;
104
105 Zero(spec);
106
107 spec.tv_sec = deadLine.Seconds();
108 spec.tv_nsec = deadLine.NanoSecondsOfSecond();
109
110 int ret = pthread_cond_timedwait(&Cond_, (pthread_mutex_t*)lock.Handle(), &spec);
111
112 Y_ABORT_UNLESS(ret == 0 || ret == ETIMEDOUT, "pthread_cond_timedwait failed: %s", LastSystemErrorText(ret));
113
114 return ret == 0;
115 }
116 }
117
118 inline void BroadCast() noexcept {
119 int ret = pthread_cond_broadcast(&Cond_);

Callers

nothing calls this directly

Calls 6

ZeroFunction · 0.85
NanoSecondsOfSecondMethod · 0.80
LastSystemErrorTextFunction · 0.70
MaxFunction · 0.50
HandleMethod · 0.45
SecondsMethod · 0.45

Tested by

no test coverage detected