6 writes to m_stateObject
System.Private.CoreLib (6)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (1)
343return ref Unsafe.As<object?, ExecutionContext?>(ref m_stateObject);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (3)
539m_stateObject = state; 6118object? failedOrCanceled = Interlocked.CompareExchange(ref m_stateObject, completedTask, null); 6137failedOrCanceled = Interlocked.CompareExchange(ref m_stateObject, new List<Task> { first, completedTask }, first);
src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (2)
247task.m_stateObject = value; 313task.m_stateObject = value;
17 references to m_stateObject
System.Private.CoreLib (17)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (4)
303Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for ExecutionContext."); 342Debug.Assert(m_stateObject is null or ExecutionContext, $"Expected {nameof(m_stateObject)} to be null or an ExecutionContext but was {(m_stateObject is object o ? o.GetType().ToString() : "(null)")}.");
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (1)
492m_result = funcWithState(m_stateObject);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (4)
1442public object? AsyncState => (m_stateFlags & (int)InternalTaskOptions.HiddenState) == 0 ? m_stateObject : null; 2403actionWithState(m_stateObject); 6060Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for faulted/canceled tasks."); 6153object? failedOrCanceled = m_stateObject;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (4)
48actionWithState(antecedent, m_stateObject); 94m_result = funcWithState(antecedent, m_stateObject); 140actionWithState(antecedent, m_stateObject); 186m_result = funcWithState(antecedent, m_stateObject);
src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (4)
208Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for Continuation."); 244public static Continuation GetContinuationState(RuntimeAsyncTask<T> task) => (Continuation)task.m_stateObject!; 274Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for Continuation."); 310public static Continuation GetContinuationState(RuntimeAsyncTask task) => (Continuation)task.m_stateObject!;