Name a Mutex
using System;
using System.Threading;
class MainClass {
public static void Main( string[] args ) {
string mutexName = "MainClass";
Mutex m = new Mutex( false, mutexName );
for( ;; ) {
m.WaitOne( );
Console.WriteLine("Have Mutex");
Console.WriteLine("Releasing");
m.ReleaseMutex( );
}
}
}
Output Have Mutex
Releasing
Have Mutex
Releasing
...
...
^CTerminate batch job (Y/N)? n
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
|