|
noexcept |
Blocks the calling thread until the function locks a mutex.
[in] | mtx | is a pointer to a mutex, ownership of which is to be acquired by the calling thread. |
The chsv_mtx_lock 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_plain type.
Use chsv_mtx_unlock to release the ownership of the mutex.
The function implements a behaviour of the mtx_lock function defined in the ISO/IEC 9899:2011 (aka C11) standard.