I'm at a loss to understand your example. The point of a mutex is to block everything/everyone (i.e. all other threads) out. Your example code would only block the same user from execting the mutexed code in more than one thread at the same time.