| 64 | } |
| 65 | |
| 66 | bool mutex::AwaitWithDeadline(const Condition &cond, uint64 abs_deadline_ns) { |
| 67 | time_t seconds = abs_deadline_ns / (1000 * 1000 * 1000); |
| 68 | nsync::nsync_time abs_time = nsync::nsync_time_s_ns( |
| 69 | seconds, abs_deadline_ns - seconds * (1000 * 1000 * 1000)); |
| 70 | return nsync::nsync_mu_wait_with_deadline(mu_cast(&mu_), &EvaluateCondition, |
| 71 | &cond, nullptr, abs_time, |
| 72 | nullptr) == 0; |
| 73 | } |
| 74 | |
| 75 | // Check that the CVData struct used to reserve space for the |
| 76 | // condition variable in tensorflow::condition_variable is big enough. |