コード例 #1
0
ファイル: AsyncWaitHandle.cs プロジェクト: fengweijp/corewf
        private 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();
            }
        }
コード例 #2
0
ファイル: AsyncWaitHandle.cs プロジェクト: fengweijp/corewf
 public AsyncWaiter(AsyncWaitHandle parent, Action <object, TimeoutException> callback, object state)
 {
     this.Parent = parent;
     _callback   = callback;
     _state      = state;
 }