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

◆ InternalDequeueChunk()

T[] System.Linq.Parallel.AsynchronousChannel< T >.InternalDequeueChunk ( )
inlineprivate

Definition at line 227 of file AsynchronousChannel.cs.

228 {
229 int consumerBufferIndex = _consumerBufferIndex;
230 T[] result = _buffer[consumerBufferIndex];
231 _buffer[consumerBufferIndex] = null;
232 Interlocked.Exchange(ref _consumerBufferIndex, (consumerBufferIndex + 1) % _buffer.Length);
233 if (_producerIsWaiting == 1 && !IsFull)
234 {
237 }
238 return result;
239 }
static int Exchange(ref int location1, int value)

References System.Linq.Parallel.AsynchronousChannel< T >._buffer, System.Linq.Parallel.AsynchronousChannel< T >._consumerBufferIndex, System.Linq.Parallel.AsynchronousChannel< T >._producerEvent, System.Linq.Parallel.AsynchronousChannel< T >._producerIsWaiting, System.Threading.Interlocked.Exchange(), System.Linq.Parallel.AsynchronousChannel< T >.IsFull, and System.Threading.ManualResetEventSlim.Set().

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