public void Wait() { lock (this) { Monitor.Wait(this); } //return mutex.WaitOne(timeout, false); }
/// <summary> /// Waits forever for the latch to be completed /// <summary> public bool await() { lock (mutex) { TimeSpan elapsed = new TimeSpan(0, 0, 5); while (remaining > 0) { mutex.Wait(elapsed); } } return(true); }