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

◆ InlineIfPossibleOrElseQueue()

static void System.Threading.Tasks.TaskContinuation.InlineIfPossibleOrElseQueue ( Task task,
bool needsProtection )
inlinestaticprotectedinherited

Definition at line 7 of file TaskContinuation.cs.

8 {
9 if (needsProtection)
10 {
11 if (!task.MarkStarted())
12 {
13 return;
14 }
15 }
16 else
17 {
18 task.m_stateFlags |= 65536;
19 }
20 try
21 {
22 if (!task.m_taskScheduler.TryRunInline(task, taskWasPreviouslyQueued: false))
23 {
24 task.m_taskScheduler.InternalQueueTask(task);
25 }
26 }
27 catch (Exception innerException)
28 {
29 TaskSchedulerException exceptionObject = new TaskSchedulerException(innerException);
30 task.AddException(exceptionObject);
31 task.Finish(userDelegateExecute: false);
32 }
33 }

References System.task.

Referenced by System.Threading.Tasks.ContinueWithTaskContinuation.Run(), and System.Threading.Tasks.TaskSchedulerAwaitTaskContinuation.Run().