Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ RentFromCache()

static StateMachineBox< TStateMachine > System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder< TResult >.StateMachineBox< TStateMachine >.RentFromCache ( )
inlinestaticpackageinherited

Definition at line 152 of file PoolingAsyncValueTaskMethodBuilder.cs.

153 {
155 if (stateMachineBox != null)
156 {
157 t_tlsCache = null;
158 }
159 else
160 {
161 ref StateMachineBox<TStateMachine> perCoreCacheSlot = ref PerCoreCacheSlot;
162 if (perCoreCacheSlot == null || (stateMachineBox = Interlocked.Exchange(ref perCoreCacheSlot, null)) == null)
163 {
164 stateMachineBox = new StateMachineBox<TStateMachine>();
165 }
166 }
167 return stateMachineBox;
168 }
static int Exchange(ref int location1, int value)

References System.Threading.Interlocked.Exchange(), System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder< TResult >.StateMachineBox< TStateMachine >.PerCoreCacheSlot, and System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder< TResult >.StateMachineBox< TStateMachine >.t_tlsCache.