public bool Wait(TimeSpan timeout) { if (!TimeoutHelper.WaitOne(_waitEvent, timeout)) { return(false); } return(_itemAvailable); }
public bool Wait(TimeSpan timeout) { if (TimeoutHelper.WaitOne(this.waitEvent, timeout)) { return(this.itemAvailable); } else { return(false); } }
public bool Wait(TimeSpan timeout, out T value) { bool flag; bool flag1 = false; try { if (!TimeoutHelper.WaitOne(this.waitEvent, timeout)) { if (!this.inputQueue.RemoveReader(this)) { this.waitEvent.WaitOne(); } else { value = default(T); flag1 = true; flag = false; return(flag); } } flag1 = true; goto Label0; } finally { if (flag1) { this.waitEvent.Close(); } } return(flag); Label0: if (this.exception == null) { value = this.item; return(true); } else { throw Fx.Exception.AsError(this.exception); } }
public bool Wait(TimeSpan timeout, out T value) { bool isSafeToClose = false; try { if (!TimeoutHelper.WaitOne(_waitEvent, timeout)) { if (_inputQueue.RemoveReader(this)) { value = default(T); isSafeToClose = true; return(false); } else { _waitEvent.WaitOne(); } } isSafeToClose = true; } finally { if (isSafeToClose) { _waitEvent.Dispose(); } } if (_exception != null) { throw Fx.Exception.AsError(_exception); } value = _item; return(true); }