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

◆ Run()

override void System.Threading.Tasks.ContinueWithTaskContinuation.Run ( Task completedTask,
bool canInlineContinuationTask )
inlinepackage

Definition at line 26 of file ContinueWithTaskContinuation.cs.

27 {
29 m_task = null;
31 if (completedTask.IsCompletedSuccessfully ? ((options & TaskContinuationOptions.NotOnRanToCompletion) == 0) : (completedTask.IsCanceled ? ((options & TaskContinuationOptions.NotOnCanceled) == 0) : ((options & TaskContinuationOptions.NotOnFaulted) == 0)))
32 {
33 if (TplEventSource.Log.IsEnabled() && !task.IsCanceled)
34 {
35 TplEventSource.Log.TraceOperationRelation(task.Id, CausalityRelation.AssignDelegate);
36 }
37 task.m_taskScheduler = m_taskScheduler;
38 if (!canInlineContinuationTask || (options & TaskContinuationOptions.ExecuteSynchronously) == 0)
39 {
40 try
41 {
42 task.ScheduleAndStart(needsProtection: true);
43 return;
44 }
45 catch (TaskSchedulerException)
46 {
47 return;
48 }
49 }
50 TaskContinuation.InlineIfPossibleOrElseQueue(task, needsProtection: true);
51 }
52 else
53 {
54 Task.ContingentProperties contingentProperties = task.m_contingentProperties;
55 if (contingentProperties == null || contingentProperties.m_cancellationToken == default(CancellationToken))
56 {
57 task.InternalCancelContinueWithInitialState();
58 }
59 else
60 {
61 task.InternalCancel();
62 }
63 }
64 }

References System.Threading.Tasks.TaskContinuation.InlineIfPossibleOrElseQueue(), System.Threading.Tasks.Task< TResult >.IsCompletedSuccessfully, System.Threading.Tasks.TplEventSource.Log, System.Threading.Tasks.Task< TResult >.ContingentProperties.m_cancellationToken, System.Threading.Tasks.ContinueWithTaskContinuation.m_options, System.Threading.Tasks.ContinueWithTaskContinuation.m_task, System.Threading.Tasks.ContinueWithTaskContinuation.m_taskScheduler, System.options, and System.task.