Exemplo n.º 1
0
 public void PulseAllMutex(IMailbox <object> me)
 {
     Safety.Assert(owner == me);
     foreach (var mailbox in waitQueue)
     {
         mailbox.Send(new object());
     }
     waitQueue.Clear();
 }
Exemplo n.º 2
0
 public void UnlockMutex(IMailbox <object> me)
 {
     Safety.Assert(owner == me);
     owner = null;
     if (lockQueue.Count <= 0)
     {
         return;
     }
     owner = lockQueue[0];
     lockQueue.RemoveAt(0);
     owner.Send(new object());
 }