I have the following questions about C1-muxes (§7.25.4):
In what situations can mtx_lock() return thrd_busy instead of locking? In what situations mtx_timedlock() return thrd_busy ?
Note that thrd_busy is defined in §7.25.1 ¶5 as being returned “when the resource requested by the check and return function is already in use”.
I would expect thrd_busy to return only mtx_trylock() , or at most also mtx_lock() when called with mtx_try or mtx_try | mtx_recursive mtx_try | mtx_recursive , but definitely not with mtx_timedlock() , which requires mutex, which supports a timeout, i.e. mutex mtx_timed or mtx_timed | mtx_recursive mtx_timed | mtx_recursive .
Is this fair and oversight in the project? Or am I missing something?
c multithreading c11 mutex
ninjalj
source share