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

◆ RunOrScheduleAction() [1/2]

static void System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction ( Action action,
bool allowInlining )
inlinestaticpackageinherited

Definition at line 148 of file AwaitTaskContinuation.cs.

149 {
150 Task t_currentTask = Task.t_currentTask;
151 if (!allowInlining || !IsValidLocationForInlining)
152 {
153 UnsafeScheduleAction(action, t_currentTask);
154 return;
155 }
156 try
157 {
158 if (t_currentTask != null)
159 {
160 Task.t_currentTask = null;
161 }
162 action();
163 }
164 catch (Exception exception)
165 {
166 Task.ThrowAsync(exception, null);
167 }
168 finally
169 {
170 if (t_currentTask != null)
171 {
172 Task.t_currentTask = t_currentTask;
173 }
174 }
175 }
static void UnsafeScheduleAction(Action action, Task task)

References System.action, System.exception, System.Threading.Tasks.AwaitTaskContinuation.IsValidLocationForInlining, System.Threading.Tasks.Task< TResult >.t_currentTask, System.Threading.Tasks.Task< TResult >.ThrowAsync(), and System.Threading.Tasks.AwaitTaskContinuation.UnsafeScheduleAction().

Referenced by System.Threading.Tasks.Task< TResult >.RunContinuations().