Template:cpp/thread/condition variable/wait for

@1@ Atomically releases, blocks the current executing thread, and adds it to the list of threads waiting on. The thread will be unblocked when notify_all or notify_one is executed, or when the relative timeout expires. It may also be unblocked spuriously. When unblocked, regardless of the reason, is reacquired and  exits.

@2@ Equivalent to. This overload may be used to ignore spurious awakenings by looping until some predicate is satisfied.

The standard recommends that a steady clock be used to measure the duration. This function may block for longer than due to scheduling or resource contention delays.

If these functions fail to meet the postcondition, std is called. For example, this could happen if relocking the mutex throws an exception.

Return value
@1@ std if the relative timeout specified by expired, std otherwise.

@2@ if the predicate  still evaluates to  after the  timeout expired, otherwise.

Exceptions
@1@ Any exception thrown by clock, time_point, or duration during the execution (clocks, time points, and durations provided by the standard library never throw)

@2@ Same as but may also propagate exceptions thrown by