| 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_); |
nothing calls this directly
no test coverage detected