|
noexcept |
Endeavours to block until it locks the specified mutex or until the absolute time specified by the chsv_xtime object xt has passed.
[in] | mtx | is a pointer to a mutex, ownership of which is to be acquired by the calling thread. |
[in] | xt | is a pointer to chsv_xtime object specifying an absolute time when a timeout of waiting should occur. |
The chsv_mtx_timedlock function blocks until it locks the mutex pointed to by mtx. If the mutex is non-recursive, and is already locked by the calling thread, the function fails returning chsv_thrd_busy. Prior calls to chsv_mtx_unlock on the same mutex shall synchronize with this operation.
The mutex must be of chsv_mtx_timed type.
Use chsv_mtx_unlock to release the ownership of the mutex.
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_mtx_timedlockfor function.
The function implements a behaviour of the mtx_timedlock function defined in the ISO/IEC 9899:2011 (aka C11) standard.