The Mutex class is very misunderstood, and Global mutexes even more so.
What is good, safe pattern to use when creating Global mutexes?
One that will work
- Regardless of the locale my machine is in
- Is guaranteed to release the mutex properly
- Optionally does not hang forever if the mutex is not acquired
- Deals with cases where other processes abandon the mutex