static void OnTimerComplete(object state) { AsyncWaiter waiter = (AsyncWaiter)state; AsyncWaitHandle thisPtr = waiter.Parent; bool callWaiter = false; lock (thisPtr.syncObject) { // If still in the waiting list (that means it hasn't been signaled) if (thisPtr.asyncWaiters != null && thisPtr.asyncWaiters.Remove(waiter)) { waiter.TimedOut = true; callWaiter = true; } } waiter.CancelTimer(); if (callWaiter) { waiter.Call(); } }
public AsyncWaiter(AsyncWaitHandle parent, Action <object, TimeoutException> callback, object state) { this.Parent = parent; this.callback = callback; this.state = state; }
public AsyncWaiter(AsyncWaitHandle parent, Action<object, TimeoutException> callback, object state) { this.Parent = parent; this.callback = callback; this.state = state; }