9public struct AsyncTaskMethodBuilder
86 if (!base.IsCompleted)
132 else if (threadPoolThread ==
null)
140 if (base.IsCompleted)
190 [DebuggerStepThrough]
210 awaiter.OnCompleted(GetStateMachineBox(ref
stateMachine, ref taskField).MoveNextAction);
228 AwaitUnsafeOnCompleted(ref awaiter, stateMachineBox);
234 if (
default(TAwaiter) !=
null && awaiter is
ITaskAwaiter)
260 awaiter.UnsafeOnCompleted(box.MoveNextAction);
273 if (asyncStateMachineBox.Context != executionContext)
275 asyncStateMachineBox.Context = executionContext;
277 return asyncStateMachineBox;
281 if (asyncStateMachineBox2.StateMachine ==
null)
286 asyncStateMachineBox2.Context = executionContext;
287 return asyncStateMachineBox2;
292 asyncStateMachineBox3.Context = executionContext;
301 return asyncStateMachineBox3;
322 return CreateDebugFinalizableAsyncStateMachineBox<IAsyncStateMachine>();
343 if (!
task.TrySetResult(result))
static void NotifyOfCrossThreadDependency()
static void SuppressFinalize(object obj)
static void SetStateMachine(IAsyncStateMachine stateMachine, Task task)
static bool TrackAsyncMethodCompletion
void ClearStateUponCompletion()
void MoveNext(Thread threadPoolThread)
static void ExecutionContextCallback(object s)
static readonly ContextCallback s_callback
override void ExecuteFromThreadPool(Thread threadPoolThread)
TStateMachine StateMachine
~DebugFinalizableAsyncStateMachineBox()
static void RunInternal(ExecutionContext executionContext, ContextCallback callback, object state)
static ? ExecutionContext Capture()
static void RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, object state)
static bool s_asyncDebuggingEnabled
static readonly Task< VoidTaskResult > s_cachedCompleted
static void ThrowAsync(Exception exception, SynchronizationContext targetContext)
static bool AddToActiveTasks(Task task)
static void RemoveFromActiveTasks(Task task)
static readonly TplEventSource Log
static void ThrowInvalidOperationException()
static void ThrowArgumentNullException(string name)
IAsyncStateMachine GetStateMachineObject()
delegate void ContextCallback(object? state)
static AsyncTaskMethodBuilder< TResult > Create()
static IAsyncStateMachineBox GetStateMachineBox< TStateMachine >(ref TStateMachine stateMachine, [NotNull] ref Task< TResult > taskField)
void SetNotificationForWaitCompletion(bool enabled)
void Start< TStateMachine >(ref TStateMachine stateMachine)
void SetException(Exception exception)
static void SetNotificationForWaitCompletion(bool enabled, [NotNull] ref Task< TResult > taskField)
static void SetException(Exception exception, ref Task< TResult > taskField)
Task< VoidTaskResult > InitializeTaskAsPromise()
static Task< TResult > CreateWeaklyTypedStateMachineBox()
static void AwaitUnsafeOnCompleted< TAwaiter >(ref TAwaiter awaiter, IAsyncStateMachineBox box)
void AwaitUnsafeOnCompleted< TAwaiter, TStateMachine >(ref TAwaiter awaiter, ref TStateMachine stateMachine)
Task< VoidTaskResult > m_task
object ObjectIdForDebugger
void SetStateMachine(IAsyncStateMachine stateMachine)
static AsyncStateMachineBox< TStateMachine > CreateDebugFinalizableAsyncStateMachineBox< TStateMachine >()
Task< TResult > InitializeTaskAsPromise()
void AwaitOnCompleted< TAwaiter, TStateMachine >(ref TAwaiter awaiter, ref TStateMachine stateMachine)
static void SetExistingTaskResult(Task< TResult > task, TResult result)
static AsyncTaskMethodBuilder Create()
void SetResult(TResult result)
static void UnsafeOnCompletedInternal(Task task, IAsyncStateMachineBox stateMachineBox, bool continueOnCapturedContext)