If I have a program like this (in pseudocode):
mutex_lock; func() { lock(mutex_lock); // Some code (long enough to make a // race condition if no pro
You may use the test mutex functions (trylock) in this kind of undefined situations, to be safe. And with this, you don't necessarily need to block too.