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

◆ Invoke() [2/2]

void System.Threading.Tasks.Task< TResult >.WhenAllPromise< T >.Invoke ( Task ignored)
inline

Implements System.Threading.Tasks.ITaskCompletionAction.

Definition at line 818 of file Task.cs.

819 {
820 if (TplEventSource.Log.IsEnabled())
821 {
822 TplEventSource.Log.TraceOperationRelation(base.Id, CausalityRelation.Join);
823 }
824 if (Interlocked.Decrement(ref m_count) != 0)
825 {
826 return;
827 }
828 T[] array = new T[m_tasks.Length];
830 Task task = null;
831 for (int i = 0; i < m_tasks.Length; i++)
832 {
834 if (task2.IsFaulted)
835 {
836 if (list == null)
837 {
839 }
840 list.AddRange(task2.GetExceptionDispatchInfos());
841 }
842 else if (task2.IsCanceled)
843 {
844 if (task == null)
845 {
846 task = task2;
847 }
848 }
849 else
850 {
851 array[i] = task2.GetResultCore(waitCompletionNotification: false);
852 }
853 if (task2.IsWaitNotificationEnabled)
854 {
856 }
857 else
858 {
859 m_tasks[i] = null;
860 }
861 }
862 if (list != null)
863 {
865 return;
866 }
867 if (task != null)
868 {
869 TrySetCanceled(task.CancellationToken, task.GetCancellationExceptionDispatchInfo());
870 return;
871 }
872 if (TplEventSource.Log.IsEnabled())
873 {
874 TplEventSource.Log.TraceOperationEnd(base.Id, AsyncCausalityStatus.Completed);
875 }
877 {
879 }
881 }
static bool s_asyncDebuggingEnabled
Definition Task.cs:960
bool TrySetCanceled(CancellationToken tokenToRecord)
Definition Task.cs:2555
bool TrySetException(object exceptionObject)
Definition Task.cs:2542
void SetNotificationForWaitCompletion(bool enabled)
Definition Task.cs:1426
static void RemoveFromActiveTasks(Task task)
Definition Task.cs:1197

References System.array, System.Threading.Interlocked.Decrement(), System.list, System.Threading.Tasks.TplEventSource.Log, System.Threading.Tasks.Task< TResult >.WhenAllPromise< T >.m_count, System.Threading.Tasks.Task< TResult >.WhenAllPromise< T >.m_tasks, System.Threading.Tasks.Task< TResult >.RemoveFromActiveTasks(), System.Threading.Tasks.Task< TResult >.s_asyncDebuggingEnabled, System.Threading.Tasks.Task< TResult >.SetNotificationForWaitCompletion(), System.task, System.Threading.Tasks.Task< TResult >.TrySetCanceled(), System.Threading.Tasks.Task< TResult >.TrySetException(), and System.Threading.Tasks.Task< TResult >.TrySetResult().