12 Oct
2015
12 Oct
'15
5:04 p.m.
Agustín K-ballo Bergé
On 10/12/2015 6:03 AM, gast128 wrote:
there is an owns_lock on the lock type but not on the mutex. This is quite unhandy. Any reason why?
A mutex could never own a lock on itself. The owner of a lock is the one responsible for calling unlock on it.
Regards,
Ok I should have expressed myself better: there seems to be no function to query a mutex if it is locked (e.g. no 'is_locked'). Use case is that I have private functions, which must assert that a non recursive mutex is locked. The locking is already done in the public part. Why is there no such function? Is there a technical reason or just overlooked?