44 if (producerBufferIndex != consumerBufferIndex - 1)
46 if (consumerBufferIndex == 0)
48 return producerBufferIndex == _buffer.Length - 1;
69 chunkSize =
Scheduling.GetDefaultChunkSize<T>();
119 _buffer[producerBufferIndex] = chunk;
186 internal bool TryDequeue([MaybeNullWhen(
false)][AllowNull] ref T
item, ref
bool isDone)
186 internal bool TryDequeue([MaybeNullWhen(
false)][AllowNull] ref T
item, ref
bool isDone) {
…}
230 T[] result =
_buffer[consumerBufferIndex];
231 _buffer[consumerBufferIndex] =
null;
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
void DoneWithDequeueWait()
bool TryDequeue([MaybeNullWhen(false)][AllowNull] ref T item, ref bool isDone)
ManualResetEventSlim _producerEvent
volatile int _consumerBufferIndex
T[] InternalDequeueChunk()
volatile int _consumerIsWaiting
volatile int _producerIsWaiting
AsynchronousChannel(int index, int chunkSize, CancellationToken cancellationToken, IntValueEvent consumerEvent)
IntValueEvent _consumerEvent
void EnqueueChunk(T[] chunk)
bool TryDequeueChunk([NotNullWhen(true)] ref T[] chunk, ref bool isDone)
readonly CancellationToken _cancellationToken
volatile int _producerBufferIndex
bool TryDequeueChunk([NotNullWhen(true)] ref T[] chunk)
bool TryDequeue([MaybeNullWhen(false)][AllowNull] ref T item)
AsynchronousChannel(int index, int capacity, int chunkSize, CancellationToken cancellationToken, IntValueEvent consumerEvent)
static int Exchange(ref int location1, int value)