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

◆ Invoke()

void System.Threading.Tasks.TaskFactory< TResult >.CompleteOnInvokePromise.Invoke ( Task completingTask)
inline

Implements System.Threading.Tasks.ITaskCompletionAction.

Definition at line 974 of file TaskFactory.cs.

975 {
977 int num = stateFlags & 2;
978 if (((uint)stateFlags & (true ? 1u : 0u)) != 0 || Interlocked.Exchange(ref _stateFlags, num | 1) != num)
979 {
980 return;
981 }
982 if (TplEventSource.Log.IsEnabled())
983 {
984 TplEventSource.Log.TraceOperationRelation(base.Id, CausalityRelation.Choice);
985 TplEventSource.Log.TraceOperationEnd(base.Id, AsyncCausalityStatus.Completed);
986 }
987 if (Task.s_asyncDebuggingEnabled)
988 {
989 Task.RemoveFromActiveTasks(this);
990 }
991 bool flag = TrySetResult(completingTask);
993 int count = tasks.Count;
994 for (int i = 0; i < count; i++)
995 {
996 Task task = tasks[i];
997 if (task != null && !task.IsCompleted)
998 {
999 task.RemoveContinuation(this);
1000 }
1001 }
1002 _tasks = null;
1003 }

References System.Threading.Interlocked.Exchange(), System.Threading.Tasks.TplEventSource.Log, System.Threading.Tasks.Task< TResult >.RemoveFromActiveTasks(), System.Threading.Tasks.Task< TResult >.s_asyncDebuggingEnabled, System.task, and System.tasks.