CSharp examples for Thread Asynchronous:Mutex
Acquire the Mutex
using System;/*from ww w . ja va 2s . c o m*/ using System.Threading; class Application { public static void Main( string[] args ) { string mutexName = args[0]; Mutex m = new Mutex( false, mutexName ); for( ;; ) { m.WaitOne( ); Console.WriteLine("Have Mutex. Press Enter to release"); Console.ReadLine( ); Console.WriteLine("Releasing"); m.ReleaseMutex( ); } } }