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