System.Runtime.CompilerServices.AsyncServices.ThrowAsync C# (CSharp) Method

ThrowAsync() static private method

static private ThrowAsync ( Exception exception, object targetContext ) : void
exception Exception
targetContext object
return void
        internal static void ThrowAsync(Exception exception, object targetContext)
        {
            new Thread(() =>
            {
                throw exception;
            }).Start();
        }
    }

Usage Example

Esempio n. 1
0
 /// <summary>指定的 awaiter 完成时,安排状态机,以继续下一操作。</summary>
 /// <typeparam name="TAwaiter"></typeparam>
 /// <typeparam name="TStateMachine"></typeparam>
 /// <param name="awaiter"></param>
 /// <param name="stateMachine"></param>
 public void AwaitOnCompleted <TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine
 {
     try
     {
         Action completionAction = m_coreState.GetCompletionAction(ref this, ref stateMachine);
         awaiter.OnCompleted(completionAction);
     }
     catch (Exception exception)
     {
         AsyncServices.ThrowAsync(exception, null);
     }
 }
All Usage Examples Of System.Runtime.CompilerServices.AsyncServices::ThrowAsync
AsyncServices