Note: If a thread called
lock or
try_lock multiple times while already having ownership of the mutex, it must also call
unlock the same number of times in order to unlock it correctly.
Warning: Calling
unlock more times than
lock on a given thread, thus ending up trying to unlock a non-locked mutex, is wrong and may causes crashes or deadlocks.