2 instantiations of StateMachineBox
System.Private.CoreLib (2)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (2)
233
internal static StateMachineBox CreateWeaklyTypedStateMachineBox() => new
StateMachineBox
<IAsyncStateMachine>();
344
box = new
StateMachineBox
<TStateMachine>();
17 references to StateMachineBox
System.Private.CoreLib (17)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (17)
173
if (boxFieldRef is
StateMachineBox
<TStateMachine> stronglyTypedBox)
191
if (boxFieldRef is
StateMachineBox
<IAsyncStateMachine> weaklyTypedBox)
221
StateMachineBox
<TStateMachine> box =
StateMachineBox
<TStateMachine>.RentFromCache();
321
private static
StateMachineBox
<TStateMachine>? t_tlsCache;
328
internal static
StateMachineBox
<TStateMachine> RentFromCache()
331
StateMachineBox
<TStateMachine>? box = t_tlsCache;
339
ref
StateMachineBox
<TStateMachine>? slot = ref PerCoreCacheSlot;
341
(box = Interlocked.Exchange<
StateMachineBox
<TStateMachine>?>(ref slot, null)) is null)
368
ref
StateMachineBox
<TStateMachine>? slot = ref PerCoreCacheSlot;
379
private static ref
StateMachineBox
<TStateMachine>? PerCoreCacheSlot
396
Debug.Assert(transientValue is null || transientValue is
StateMachineBox
<TStateMachine>,
397
$"Expected null or {nameof(
StateMachineBox
<TStateMachine>)}, got '{transientValue}'");
399
return ref Unsafe.As<object?,
StateMachineBox
<TStateMachine>?>(ref s_perCoreCache[i].Object);
420
Debug.Assert(s is
StateMachineBox
<TStateMachine>, $"Expected {nameof(
StateMachineBox
<TStateMachine>)}, got '{s}'");
421
Unsafe.As<
StateMachineBox
<TStateMachine>>(s).StateMachine!.MoveNext();