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