13public struct PoolingAsyncValueTaskMethodBuilder
28 return new ValueTask(stateMachineBox, stateMachineBox.Version);
155 if (stateMachineBox !=
null)
162 if (perCoreCacheSlot ==
null || (stateMachineBox =
Interlocked.
Exchange(ref perCoreCacheSlot,
null)) ==
null)
167 return stateMachineBox;
181 if (perCoreCacheSlot ==
null)
318 awaiter.OnCompleted(GetStateMachineBox(ref
stateMachine, ref box).MoveNextAction);
344 if (stateMachineBox.Context != executionContext)
346 stateMachineBox.Context = executionContext;
348 return stateMachineBox;
352 if (stateMachineBox2.StateMachine ==
null)
357 stateMachineBox2.Context = executionContext;
358 return stateMachineBox2;
363 stateMachineBox3.Context = executionContext;
364 return stateMachineBox3;
static void NotifyOfCrossThreadDependency()
static int ProcessorCount
static Exception ByDesign
static void SetStateMachine(IAsyncStateMachine stateMachine, Task task)
static StateMachineBox< TStateMachine > RentFromCache()
ValueTaskSourceStatus GetStatus(short token)
ManualResetValueTaskSourceCore< TResult > _valueTaskSource
static StateMachineBox< TStateMachine > t_tlsCache
TStateMachine StateMachine
void SetException(Exception error)
void OnCompleted(Action< object > continuation, object state, short token, ValueTaskSourceOnCompletedFlags flags)
void ClearStateUponCompletion()
void SetResult(TResult result)
static readonly PaddedReference[] s_perCoreCache
static ref StateMachineBox< TStateMachine > PerCoreCacheSlot
static readonly ContextCallback s_callback
static void ExecutionContextCallback(object s)
SyncSuccessSentinelStateMachineBox()
static void RunInternal(ExecutionContext executionContext, ContextCallback callback, object state)
static ? ExecutionContext Capture()
static int Exchange(ref int location1, int value)
static void ThrowAsync(Exception exception, SynchronizationContext targetContext)
static int GetCurrentProcessorId()
static void Write(ref bool location, bool value)
static void ThrowArgumentNullException(string name)
IAsyncStateMachine GetStateMachineObject()
void GetResult(short token)
ValueTaskSourceOnCompletedFlags
delegate void ContextCallback(object? state)
static readonly PoolingAsyncValueTaskMethodBuilder< VoidTaskResult >.StateMachineBox s_syncSuccessSentinel
void SetException(Exception exception)
void AwaitUnsafeOnCompleted< TAwaiter, TStateMachine >(ref TAwaiter awaiter, ref TStateMachine stateMachine)
void Start< TStateMachine >(ref TStateMachine stateMachine)
static IAsyncStateMachineBox GetStateMachineBox< TStateMachine >(ref TStateMachine stateMachine, [NotNull] ref StateMachineBox boxFieldRef)
void SetResult(TResult result)
void SetStateMachine(IAsyncStateMachine stateMachine)
static void SetException(Exception exception, [NotNull] ref StateMachineBox boxFieldRef)
PoolingAsyncValueTaskMethodBuilder< VoidTaskResult >.StateMachineBox m_task
static StateMachineBox CreateWeaklyTypedStateMachineBox()
static PoolingAsyncValueTaskMethodBuilder Create()
static PoolingAsyncValueTaskMethodBuilder< TResult > Create()
void AwaitOnCompleted< TAwaiter, TStateMachine >(ref TAwaiter awaiter, ref TStateMachine stateMachine)