Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<type fullname="System.Threading.Tasks.Task">
<property name="ParentForDebugger" />
<property name="StateFlagsForDebugger" />
<property name="StateFlags" />
<method name="GetDelegateContinuationsForDebugger" />
<method name="SetNotificationForWaitCompletion" />
</type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ internal bool TrySetResult(TResult? result)
// been recorded, and (4) Cancellation has not been requested.
//
// If the reservation is successful, then set the result and finish completion processing.
if (AtomicStateUpdate(TASK_STATE_COMPLETION_RESERVED,
TASK_STATE_COMPLETION_RESERVED | TASK_STATE_RAN_TO_COMPLETION | TASK_STATE_FAULTED | TASK_STATE_CANCELED))
if (AtomicStateUpdate((int)TaskStateFlags.CompletionReserved,
(int)TaskStateFlags.CompletionReserved | (int)TaskStateFlags.RanToCompletion | (int)TaskStateFlags.Faulted | (int)TaskStateFlags.Canceled))
{
m_result = result;

Expand All @@ -390,7 +390,7 @@ internal bool TrySetResult(TResult? result)
// However, that goes through a windy code path, involves many non-inlineable functions
// and which can be summarized more concisely with the following snippet from
// FinishStageTwo, omitting everything that doesn't pertain to TrySetResult.
Interlocked.Exchange(ref m_stateFlags, m_stateFlags | TASK_STATE_RAN_TO_COMPLETION);
Interlocked.Exchange(ref m_stateFlags, m_stateFlags | (int)TaskStateFlags.RanToCompletion);
ContingentProperties? props = m_contingentProperties;
if (props != null)
{
Expand Down Expand Up @@ -425,7 +425,7 @@ internal void DangerousSetResult(TResult result)
else
{
m_result = result;
m_stateFlags |= TASK_STATE_RAN_TO_COMPLETION;
m_stateFlags |= (int)TaskStateFlags.RanToCompletion;
}
}

Expand Down
Loading