After a thread A
has called unlock()
, releasing a mutex, it is possible for another
to lock the same mutex, observe that it is no longer in use, unlock it, and
destroy it, before thread A
appears to have returned from its unlock call.
handle such scenarios correctly, as long as thread A
does not access the
mutex after the unlock call returns.