3 implementations of IAsyncStateMachineBox
System.Private.CoreLib (3)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncStateMachineDispatcher.cs (1)
262internal sealed class AsyncStateMachineDispatcher : Task<VoidTaskResult>, IAsyncStateMachineBox, IAsyncStateMachineDispatcher
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (1)
416Task<TResult>, IAsyncStateMachineBox
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (1)
311IValueTaskSource<TResult>, IValueTaskSource, IAsyncStateMachineBox, IThreadPoolWorkItem
61 references to IAsyncStateMachineBox
System.Private.CoreLib (61)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncIteratorMethodBuilder.cs (1)
78if (m_task is IAsyncStateMachineBox box)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (3)
120target is IAsyncStateMachineBox sm ? sm.GetStateMachineObject().MoveNext : 130internal static IAsyncStateMachineBox? TryGetStateMachineBox(Action continuation) 133if (target is IAsyncStateMachineBox box)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.cs (9)
158public IAsyncStateMachineBox? LastContinuation; 1041public static void Append(ref AsyncStateMachineDispatcherInfo info, IAsyncStateMachineBox enteringBox, AsyncThreadContext context, long currentTimestamp) 1158public static void Resume(ref AsyncStateMachineDispatcherInfo info, IAsyncStateMachineBox box) 1612IAsyncStateMachineBox? box = ResolveAsyncStateMachineBox(info.AsyncProfilerInfo.CurrentContinuation); 1629IAsyncStateMachineBox? box = ResolveAsyncStateMachineBox(continuation); 1721IAsyncStateMachineBox? box = ResolveAsyncStateMachineBox(continuationObject); 1734private static IAsyncStateMachineBox? ResolveAsyncStateMachineBox(object? continuationObject) 1741if (continuationObject is IAsyncStateMachineBox box) 1755IAsyncStateMachineBox? resolved = ResolveAsyncStateMachineBox(list[i]);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncStateMachineDispatcher.cs (11)
54IAsyncStateMachineBox? last = AsyncProfilerInfo.LastContinuation; 66internal static unsafe IAsyncStateMachineBox CreateDispatcher(IAsyncStateMachineBox box, AsyncInstrumentation.Flags flags) 156internal static unsafe void ResumeAsyncMethod(IAsyncStateMachineBox box, AsyncInstrumentation.Flags flags) 185private static unsafe void ResumeAsyncMethod(AsyncStateMachineDispatcherInfo* info, IAsyncStateMachineBox box, bool methodEventEnabled, bool callstackEnabled) 264private IAsyncStateMachineBox? _inner; 266internal IAsyncStateMachineBox? InnerBox => _inner; 268internal AsyncStateMachineDispatcher(IAsyncStateMachineBox inner) : base() 288IAsyncStateMachineBox? inner = _inner; 328IAsyncStateMachineBox? inner = _inner; 340IAsyncStateMachineBox? inner = _inner;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (7)
64IAsyncStateMachineBox box = GetStateMachineBox(ref stateMachine, ref taskField); 101IAsyncStateMachineBox box = GetStateMachineBox(ref stateMachine, ref taskField); 109ref TAwaiter awaiter, IAsyncStateMachineBox box) 170private static IAsyncStateMachineBox GetStateMachineBox<TStateMachine>( 177IAsyncStateMachineBox result; 583IAsyncStateMachine IAsyncStateMachineBox.GetStateMachineObject() => StateMachine!; // likely boxes, only use for debugging 585bool IAsyncStateMachineBox.GetDiagnosticData(out ulong methodId, out int state, out object? nextContinuation)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConfiguredValueTaskAwaitable.cs (4)
94void IStateMachineBoxAwareAwaiter.AwaitUnsafeOnCompleted(IAsyncStateMachineBox box) 105if (AsyncInstrumentation.IsActive && AsyncInstrumentation.LoadFlags(out AsyncInstrumentation.Flags flags) && obj is not IAsyncStateMachineBox) 207void IStateMachineBoxAwareAwaiter.AwaitUnsafeOnCompleted(IAsyncStateMachineBox box) 218if (AsyncInstrumentation.IsActive && AsyncInstrumentation.LoadFlags(out AsyncInstrumentation.Flags flags) && obj is not IAsyncStateMachineBox)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (5)
118IAsyncStateMachineBox ibox = GetStateMachineBox(ref stateMachine, ref box); 152IAsyncStateMachineBox box = GetStateMachineBox(ref stateMachine, ref boxRef); 161private static IAsyncStateMachineBox GetStateMachineBox<TStateMachine>( 481IAsyncStateMachine IAsyncStateMachineBox.GetStateMachineObject() => StateMachine!; // likely boxes, only use for debugging 483bool IAsyncStateMachineBox.GetDiagnosticData(out ulong methodId, out int state, out object? nextContinuation)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (2)
196internal static void UnsafeOnCompletedInternal(Task task, IAsyncStateMachineBox stateMachineBox, bool continueOnCapturedContext) 204if (task is not IAsyncStateMachineBox)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ValueTaskAwaiter.cs (5)
86void IStateMachineBoxAwareAwaiter.AwaitUnsafeOnCompleted(IAsyncStateMachineBox box) 97if (AsyncInstrumentation.IsActive && AsyncInstrumentation.LoadFlags(out AsyncInstrumentation.Flags flags) && obj is not IAsyncStateMachineBox) 176void IStateMachineBoxAwareAwaiter.AwaitUnsafeOnCompleted(IAsyncStateMachineBox box) 187if (AsyncInstrumentation.IsActive && AsyncInstrumentation.LoadFlags(out AsyncInstrumentation.Flags flags) && obj is not IAsyncStateMachineBox) 209void AwaitUnsafeOnCompleted(IAsyncStateMachineBox box);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\YieldAwaitable.cs (3)
116void IStateMachineBoxAwareAwaiter.AwaitUnsafeOnCompleted(IAsyncStateMachineBox box) 141syncCtx.Post(static s => ((IAsyncStateMachineBox)s!).MoveNext(), box); 152Task.Factory.StartNew(static s => ((IAsyncStateMachineBox)s!).MoveNext(), box, default, TaskCreationOptions.PreferFairness, scheduler);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (4)
2710internal void UnsafeSetContinuationForAwait(IAsyncStateMachineBox stateMachineBox, bool continueOnCapturedContext) 3645case IAsyncStateMachineBox stateMachineBox: 3727case IAsyncStateMachineBox stateMachineBox: 3766case IAsyncStateMachineBox stateMachineBox:
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (2)
770/// <param name="box">The <see cref="IAsyncStateMachineBox"/> that needs to be invoked or queued.</param> 774internal static void RunOrScheduleAction(IAsyncStateMachineBox box, bool allowInlining)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TplEventSource.cs (1)
546public void IncompleteAsyncMethod(IAsyncStateMachineBox stateMachineBox)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (4)
1355/// <summary>Shim used to invoke <see cref="IAsyncStateMachineBox.MoveNext"/> of the supplied <see cref="IAsyncStateMachineBox"/>.</summary> 1358if (state is IAsyncStateMachineBox box) 1590if (state is not IAsyncStateMachineBox)