template<typename Rep,typename Period> cv_status wait_for( std::unique_lock<std::mutex>& lock, std::chrono::duration<Rep,Period> const& relative_time);
true, and the lock
is owned by the calling thread.
Atomically unlock the supplied
object and block until the the thread is woken by a call to
by another thread, or the time period specified by
relative_time has elapsed or
the thread is woken spuriously. The
object is locked again before the call to
The spurious wake ups mean that a thread calling
may wake even though no thread has called
It is therefore recommended that the overload
that takes a predicate is used in preference where possible.
Otherwise, it is recommended that
be called in a loop which tests the predicate associated with the
condition variable. Care must be taken when doing this to ensure
that the timeout is still valid;
may be more appropriate in many circumstances. The thread may be
blocked for longer than the specified duration. Where possible,
the elapsed time is determined by a steady clock.
on a single
are serialized. A call to
will only wake threads that started waiting prior
to that call.