How can I achieve mutual exclusion using two named mutexes? The following code should work but it doesn't:
[TestMethod]
public void xdfgndygfn()
{
using (var mutex1 = new Mutex(false, "1234"))
using (var mutex2 = new Mutex(false, "1234"))
{
mutex1.WaitOne();
mutex2.WaitOne(); //this should block, but it doesn't
}
}
Using Process Explorer I verified that there are two mutex handles referring to the same name. This should work... What am I missing?