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

◆ RunOrScheduleAction() [2/2]

static void System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction ( IAsyncStateMachineBox box,
bool allowInlining )
inlinestaticpackageinherited

Definition at line 177 of file AwaitTaskContinuation.cs.

178 {
179 Task t_currentTask = Task.t_currentTask;
180 if (!allowInlining || !IsValidLocationForInlining)
181 {
182 if (TplEventSource.Log.IsEnabled())
183 {
184 UnsafeScheduleAction(box.MoveNextAction, t_currentTask);
185 }
186 else
187 {
188 ThreadPool.UnsafeQueueUserWorkItemInternal(box, preferLocal: true);
189 }
190 return;
191 }
192 try
193 {
194 if (t_currentTask != null)
195 {
196 Task.t_currentTask = null;
197 }
198 box.MoveNext();
199 }
200 catch (Exception exception)
201 {
202 Task.ThrowAsync(exception, null);
203 }
204 finally
205 {
206 if (t_currentTask != null)
207 {
208 Task.t_currentTask = t_currentTask;
209 }
210 }
211 }
static void UnsafeScheduleAction(Action action, Task task)

References System.exception, System.Threading.Tasks.AwaitTaskContinuation.IsValidLocationForInlining, System.Threading.Tasks.TplEventSource.Log, System.Runtime.CompilerServices.IAsyncStateMachineBox.MoveNext(), System.Runtime.CompilerServices.IAsyncStateMachineBox.MoveNextAction, System.Threading.Tasks.Task< TResult >.t_currentTask, System.Threading.Tasks.Task< TResult >.ThrowAsync(), System.Threading.ThreadPool.UnsafeQueueUserWorkItemInternal(), and System.Threading.Tasks.AwaitTaskContinuation.UnsafeScheduleAction().