static void OnEnterComplete(object state, Exception asyncException) { SynchronizedAsyncResult <T> thisPtr = (SynchronizedAsyncResult <T>)state; Exception completionException = asyncException; bool completeSelf; if (completionException != null) { completeSelf = true; } else { try { thisPtr.exitLock = true; completeSelf = thisPtr.PerformOperation(thisPtr.timeoutHelper.RemainingTime()); } #pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) { throw; } completeSelf = true; completionException = e; } } if (completeSelf) { thisPtr.CompleteWithUnlock(false, completionException); } }
public bool EndWaitForMessage(IAsyncResult result) { return(SynchronizedAsyncResult <bool> .End(result)); }
public static T End(IAsyncResult result) { SynchronizedAsyncResult <T> thisPtr = AsyncResult.End <SynchronizedAsyncResult <T> >(result); return(thisPtr.returnValue); }
public Message EndReceive(IAsyncResult result) { return(SynchronizedAsyncResult <Message> .End(result)); }