Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mutex locker = new Mutex();
- if (locker.WaitOne(1000)) {
- Thread.Sleep(2000);
- locker.ReleaseMutex();
- Console.WriteLine("has released the mutex");
- } else {
- Console.WriteLine("will not acquire the mutex");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement