anjna....@gmail.com
unread,Feb 25, 2015, 9:20:41 PM2/25/15You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi I made following program
using System;
using System.Threading;
namespace mutex
{
class Program
{
static void Main(string[] args)
{
Mutex mutex =null , mutex1 =null;
string mutexName = "test";
try
{
mutex = new Mutex(false /*initiallyOwned*/, mutexName);
mutex.WaitOne(0, false);
mutex1 = new Mutex(false /*initiallyOwned*/, mutexName);
mutex1.WaitOne(0, false);
}
finally
{
Console.WriteLine("released mutex");
Thread.Sleep(30000);
if (null != mutex1) mutex1.ReleaseMutex();
if (null != mutex) mutex.ReleaseMutex();
}
}
}
}
The exe should block after 2nd waitone call as would have locked the mutex till release mutex is called. But it does not stop at 2nd waitone why?