|
noexcept |
Endeavors to lock the specified mutex and returns without blocking even if the mutex ownership cannot be acquired.
[in] | mtx | is a pointer to a mutex, ownership of which is to be acquired by the calling thread. |
The function endeavors to lock the mutex pointed to by mtx. The specified mutex shall support either test and return or timeout. If the mutex is already locked, the function returns without blocking. If the operation succeeds, prior calls to chsv_mtx_unlock on the same mutex shall synchronize with this operation.
The mutex must be of either chsv_mtx_try or chsv_mtx_timed type.
Use chsv_mtx_unlock to release the ownership of the mutex.
The function implements a behaviour of the mtx_trylock function defined in the ISO/IEC 9899:2011 (aka C11) standard.