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

◆ AwaitUnsafeOnCompleted()

void IStateMachineBoxAwareAwaiter. System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter.AwaitUnsafeOnCompleted ( IAsyncStateMachineBox box)
inline

Implements System.Runtime.CompilerServices.IStateMachineBoxAwareAwaiter.

Definition at line 64 of file YieldAwaitable.cs.

65 {
66 if (TplEventSource.Log.IsEnabled())
67 {
68 QueueContinuation(box.MoveNextAction, flowContext: false);
69 return;
70 }
72 if (current != null && current.GetType() != typeof(SynchronizationContext))
73 {
74 current.Post(delegate(object s)
75 {
76 ((IAsyncStateMachineBox)s).MoveNext();
77 }, box);
78 return;
79 }
81 if (current2 == TaskScheduler.Default)
82 {
83 ThreadPool.UnsafeQueueUserWorkItemInternal(box, preferLocal: false);
84 return;
85 }
86 Task.Factory.StartNew(delegate(object s)
87 {
88 ((IAsyncStateMachineBox)s).MoveNext();
89 }, box, default(CancellationToken), TaskCreationOptions.PreferFairness, current2);
90 }
virtual void Post(SendOrPostCallback d, object? state)
static ? SynchronizationContext Current
static new TaskFactory< TResult > Factory
Definition Task.cs:56
static readonly TplEventSource Log
static void UnsafeQueueUserWorkItemInternal(object callBack, bool preferLocal)
static void QueueContinuation(Action continuation, bool flowContext)

References System.Threading.Tasks.TaskScheduler.Current, System.Threading.SynchronizationContext.Current, System.Threading.Tasks.TaskScheduler.Default, System.Threading.Tasks.Task< TResult >.Factory, System.Threading.Tasks.TplEventSource.Log, System.Runtime.CompilerServices.IAsyncStateMachineBox.MoveNextAction, System.Threading.SynchronizationContext.Post(), System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter.QueueContinuation(), System.s, and System.Threading.ThreadPool.UnsafeQueueUserWorkItemInternal().