Wait until the condition variable is notified or 'abs_time' has passed. Returns true if the condition variable is notified before the absolute timeout specified in 'abs_time' has passed. Returns false otherwise.
| 53 | /// Returns true if the condition variable is notified before the absolute timeout |
| 54 | /// specified in 'abs_time' has passed. Returns false otherwise. |
| 55 | bool WaitUntil(std::unique_lock<std::mutex>& lock, const timespec& abs_time) { |
| 56 | DCHECK(lock.owns_lock()); |
| 57 | pthread_mutex_t* mutex = lock.mutex()->native_handle(); |
| 58 | return pthread_cond_timedwait(&cv_, mutex, &abs_time) == 0; |
| 59 | } |
| 60 | |
| 61 | /// Wait until the condition variable is notified or 'duration_us' microseconds |
| 62 | /// have passed. Returns true if the condition variable is notified in time. |
no test coverage detected