Exemplo n.º 1
0
            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);
                }
            }
Exemplo n.º 2
0
 public bool EndWaitForMessage(IAsyncResult result)
 {
     return(SynchronizedAsyncResult <bool> .End(result));
 }
Exemplo n.º 3
0
            public static T End(IAsyncResult result)
            {
                SynchronizedAsyncResult <T> thisPtr = AsyncResult.End <SynchronizedAsyncResult <T> >(result);

                return(thisPtr.returnValue);
            }
Exemplo n.º 4
0
 public Message EndReceive(IAsyncResult result)
 {
     return(SynchronizedAsyncResult <Message> .End(result));
 }