Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.26 KB | None | 0 0
  1. Mutex locker = new Mutex();
  2.            
  3.  if (locker.WaitOne(1000)) {
  4.  
  5.    Thread.Sleep(2000);
  6.    locker.ReleaseMutex();
  7.    Console.WriteLine("has released the mutex");
  8.      
  9. } else {
  10.      
  11.    Console.WriteLine("will not acquire the mutex");
  12.      
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement