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

◆ SetContinuationForAwait() [2/2]

void System.Threading.Tasks.Task< TResult >.SetContinuationForAwait ( Action continuationAction,
bool continueOnCapturedContext,
bool flowExecutionContext )
inlinepackageinherited

Definition at line 2153 of file Task.cs.

2154 {
2155 TaskContinuation taskContinuation = null;
2157 {
2158 SynchronizationContext current = SynchronizationContext.Current;
2159 if (current != null && current.GetType() != typeof(SynchronizationContext))
2160 {
2161 taskContinuation = new SynchronizationContextAwaitTaskContinuation(current, continuationAction, flowExecutionContext);
2162 }
2163 else
2164 {
2165 TaskScheduler internalCurrent = TaskScheduler.InternalCurrent;
2166 if (internalCurrent != null && internalCurrent != TaskScheduler.Default)
2167 {
2168 taskContinuation = new TaskSchedulerAwaitTaskContinuation(internalCurrent, continuationAction, flowExecutionContext);
2169 }
2170 }
2171 }
2173 {
2174 taskContinuation = new AwaitTaskContinuation(continuationAction, flowExecutionContext: true);
2175 }
2176 if (taskContinuation != null)
2177 {
2179 {
2181 }
2182 }
2184 {
2185 AwaitTaskContinuation.UnsafeScheduleAction(continuationAction, this);
2186 }
2187 }
bool AddTaskContinuation(object tc, bool addBeforeOthers)
Definition Task.cs:2992

References System.Threading.Tasks.Task< TResult >.AddTaskContinuation(), System.continuationAction, System.Threading.SynchronizationContext.Current, System.Threading.Tasks.TaskScheduler.Default, System.Threading.Tasks.TaskScheduler.InternalCurrent, and System.Threading.Tasks.AwaitTaskContinuation.UnsafeScheduleAction().