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

◆ ConcurrentQueue() [2/2]

Definition at line 104 of file ConcurrentQueue.cs.

105 {
106 if (collection == null)
107 {
108 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection);
109 }
110 _crossSegmentLock = new object();
111 int num = 32;
112 if (collection is ICollection<T> { Count: var count } && count > num)
113 {
114 num = (int)Math.Min(BitOperations.RoundUpToPowerOf2((uint)count), 1048576u);
115 }
117 foreach (T item in collection)
118 {
119 Enqueue(item);
120 }
121 }
volatile ConcurrentQueueSegment< T > _tail
volatile ConcurrentQueueSegment< T > _head
static uint RoundUpToPowerOf2(uint value)

References System.Collections.Concurrent.ConcurrentQueue< T >._crossSegmentLock, System.Collections.Concurrent.ConcurrentQueue< T >._head, System.Collections.Concurrent.ConcurrentQueue< T >._tail, System.collection, System.count, System.Collections.Concurrent.ConcurrentQueue< T >.Count, System.Collections.Concurrent.ConcurrentQueue< T >.Enqueue(), System.item, System.Math.Min(), System.Numerics.BitOperations.RoundUpToPowerOf2(), and System.ThrowHelper.ThrowArgumentNullException().