9[DebuggerDisplay(
"Items={ItemsCountForDebugger}, Closed={ChannelIsClosedForDebugger}")]
13 [DebuggerDisplay(
"Items={ItemsCountForDebugger}")]
55 if (parent._doneWriting !=
null)
57 return ChannelUtilities.GetInvalidCompletionValueTask<T>(parent._doneWriting);
81 if (parent._items.TryDequeue(
out item))
83 if (parent._doneWriting !=
null && parent._items.IsEmpty)
110 lock (parent.SyncObj)
112 if (!parent._items.IsEmpty)
116 if (parent._doneWriting !=
null)
145 [DebuggerDisplay(
"Items={ItemsCountForDebugger}")]
164 lock (parent.SyncObj)
166 if (parent._doneWriting !=
null)
171 if (parent._items.IsEmpty)
174 if (parent._blockedReader !=
null)
177 parent._blockedReader =
null;
179 if (parent._waitingReader !=
null)
182 parent._waitingReader =
null;
217 lock (parent.SyncObj)
219 if (parent._doneWriting !=
null)
226 parent._blockedReader =
null;
230 parent._items.Enqueue(
item);
236 parent._waitingReader =
null;
Enumerator GetEnumerator()
static readonly Exception s_doneWritingSentinel
static void Complete(TaskCompletionSource tcs, Exception error=null)
static Exception CreateInvalidCompletionException(Exception inner=null)
readonly AsyncOperation< bool > _waiterSingleton
UnboundedChannelReader(SingleConsumerUnboundedChannel< T > parent)
readonly AsyncOperation< T > _readerSingleton
override ValueTask< T > ReadAsync(CancellationToken cancellationToken)
int ItemsCountForDebugger
override ValueTask< bool > WaitToReadAsync(CancellationToken cancellationToken)
override bool TryRead([MaybeNullWhen(false)] out T item)
override bool TryPeek([MaybeNullWhen(false)] out T item)
readonly SingleConsumerUnboundedChannel< T > _parent
override ValueTask< bool > WaitToWriteAsync(CancellationToken cancellationToken)
override ValueTask WriteAsync(T item, CancellationToken cancellationToken)
int ItemsCountForDebugger
override bool TryComplete(Exception error)
UnboundedChannelWriter(SingleConsumerUnboundedChannel< T > parent)
readonly SingleConsumerUnboundedChannel< T > _parent
override bool TryWrite(T item)
readonly SingleProducerSingleConsumerQueue< T > _items
readonly TaskCompletionSource _completion
volatile Exception _doneWriting
int ItemsCountForDebugger
readonly bool _runContinuationsAsynchronously
AsyncOperation< T > _blockedReader
AsyncOperation< bool > _waitingReader
bool ChannelIsClosedForDebugger
SingleConsumerUnboundedChannel(bool runContinuationsAsynchronously)
static Task FromException(Exception exception)
static Task FromCanceled(CancellationToken cancellationToken)