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

◆ AddTaskContinuationComplex()

bool System.Threading.Tasks.Task< TResult >.AddTaskContinuationComplex ( object tc,
bool addBeforeOthers )
inlineprivateinherited

Definition at line 2960 of file Task.cs.

2961 {
2964 {
2965 Interlocked.CompareExchange(ref m_continuationObject, new List<object> { continuationObject }, continuationObject);
2966 }
2968 {
2969 lock (list)
2970 {
2972 {
2973 if (list.Count == list.Capacity)
2974 {
2975 list.RemoveAll((object l) => l == null);
2976 }
2977 if (addBeforeOthers)
2978 {
2979 list.Insert(0, tc);
2980 }
2981 else
2982 {
2983 list.Add(tc);
2984 }
2985 return true;
2986 }
2987 }
2988 }
2989 return false;
2990 }
void Add(TKey key, TValue value)
volatile object m_continuationObject
Definition Task.cs:956
static readonly object s_taskCompletionSentinel
Definition Task.cs:958

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Threading.Interlocked.CompareExchange(), System.list, System.Threading.Tasks.Task< TResult >.m_continuationObject, and System.Threading.Tasks.Task< TResult >.s_taskCompletionSentinel.

Referenced by System.Threading.Tasks.Task< TResult >.AddTaskContinuation().