absl::Clock::AwaitWithDeadline

Returns when cond is true or the deadline has passed. Returns true iff cond holds when returning.

Synopsis

Declared in <absl/time/clock_interface.h>

virtual
bool
AwaitWithDeadline(
    absl::Mutex* mu,
    absl::Condition const& cond,
    absl::Time deadline) = 0;

Description

Requires *mu to be held at least in shared mode. It will be held when evaluating cond, and upon return, but it may be released and reacquired in the meantime.

This method is similar to mu->AwaitWithDeadline() except that the latter only works with real-time deadlines. This call works properly with simulated time if invoked on a simulated clock.

Return Value

true iff cond holds when returning.

Parameters

NameDescription
muThe mutex guarding cond, held at least in shared mode.
condThe condition to wait on.
deadlineThe time by which to stop waiting.