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

◆ EnqueueChunk()

void System.Linq.Parallel.AsynchronousChannel< T >.EnqueueChunk ( T[] chunk)
inlineprivate

Definition at line 112 of file AsynchronousChannel.cs.

113 {
114 if (IsFull)
115 {
117 }
118 int producerBufferIndex = _producerBufferIndex;
119 _buffer[producerBufferIndex] = chunk;
120 Interlocked.Exchange(ref _producerBufferIndex, (producerBufferIndex + 1) % _buffer.Length);
122 {
125 }
126 }
static int Exchange(ref int location1, int value)

References System.Linq.Parallel.AsynchronousChannel< T >._buffer, System.Linq.Parallel.AsynchronousChannel< T >._consumerEvent, System.Linq.Parallel.AsynchronousChannel< T >._consumerIsWaiting, System.Linq.Parallel.AsynchronousChannel< T >._index, System.Linq.Parallel.AsynchronousChannel< T >._producerBufferIndex, System.Threading.Interlocked.Exchange(), System.Linq.Parallel.AsynchronousChannel< T >.IsChunkBufferEmpty, System.Linq.Parallel.AsynchronousChannel< T >.IsFull, System.Linq.Parallel.IntValueEvent.Set(), and System.Linq.Parallel.AsynchronousChannel< T >.WaitUntilNonFull().

Referenced by System.Linq.Parallel.AsynchronousChannel< T >.Enqueue(), and System.Linq.Parallel.AsynchronousChannel< T >.FlushCachedChunk().