|
noexcept |
Endeavors to block until it locks the specified mutex or until the time, specified in milliseconds elapses.
[in] | mtx | is a pointer to a mutex, ownership of which is to be acquired by the calling thread. |
[in] | cMilliseconds | is a whole number of milliseconds for the function to wait for the mutex ownership to be granted. |
The chsv_mtx_timedlockfor 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.
This is an extension to the chsv_mtx_timedlock function which implements waiting for an absolute time specified as chsv_xtime object as specified by the C11 standard. The chsv_mtx_timedlockfor function uses a relative time passed since the moment of a call.