|
noexcept |
Atomically unlocks the specified mutex and endeavours to block until the specified condition variable is signalled by a call to chsv_cnd_signal or to chsv_cnd_broadcast, or until after the time specified by the chsv_xtime object.
[in] | pCnd | is a pointer to a descriptor of the condition variable object to be waited for. |
[in] | pMtx | is a pointer to a mutex object to be atomically signalled before the waiting for the condition variable. When the condition variable is signalled so that the calling thread becomes unlocked, the thread atomically endeavours to lock the mutex with blocking. The mutex has to be owned by the calling thread before the call. Otherwise the function will abort execution of the whole program by calling the abort function. |
[in] | pXt | is a pointer to chsv_xtime object specifying an absolute time when a timeout of waiting should occur. |
An absolute time is a time passed since the Epoch. See chsv_xtime_get for more details.
To specify a relative time use the chsv_cnd_timedwaitfor function.
On POSIX systems (see the IEEE Str 1003.1 standard) the implementation sometimes spurious wakeups of threads, blocked while waiting for the condition variable, may occur. The function does not handle these wakeups and it is up to the caller to verify them.
The function implements a behaviour of the cnd_timedwait function defined in the ISO/IEC 9899:2011 (aka C11) standard.