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

◆ RunCallback()

void System.Threading.Tasks.AwaitTaskContinuation.RunCallback ( ContextCallback callback,
object state,
ref Task currentTask )
inlineprotectedinherited

Definition at line 116 of file AwaitTaskContinuation.cs.

117 {
118 Task task = currentTask;
119 try
120 {
121 if (task != null)
122 {
123 currentTask = null;
124 }
125 ExecutionContext capturedContext = m_capturedContext;
126 if (capturedContext == null)
127 {
128 callback(state);
129 }
130 else
131 {
132 ExecutionContext.RunInternal(capturedContext, callback, state);
133 }
134 }
135 catch (Exception exception)
136 {
137 Task.ThrowAsync(exception, null);
138 }
139 finally
140 {
141 if (task != null)
142 {
143 currentTask = task;
144 }
145 }
146 }

References System.exception, System.Threading.Tasks.AwaitTaskContinuation.m_capturedContext, System.Threading.ExecutionContext.RunInternal(), System.state, System.task, and System.Threading.Tasks.Task< TResult >.ThrowAsync().

Referenced by System.Threading.Tasks.AwaitTaskContinuation.Run(), and System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run().