47 references to State
System.Net.Quic (47)
System\Net\Quic\Internal\ResettableValueTaskSource.cs (47)
28
private
State
_state;
39
_state =
State
.None;
58
public bool IsCompleted => (
State
)Volatile.Read(ref Unsafe.As<
State
, byte>(ref _state)) ==
State
.Completed;
61
/// Tries to get a value task representing this task source. If this task source is <see cref="
State
.None"/>, it'll also transition it into <see cref="
State
.Awaiting"/> state.
62
/// It prevents concurrent operations from being invoked since it'll return <c>false</c> if the task source was already in <see cref="
State
.Awaiting"/> state.
75
if (_state ==
State
.None)
92
State
state = _state;
95
if (state ==
State
.None)
105
_state =
State
.Awaiting;
108
if (state is
State
.None or
State
.Ready or
State
.Completed)
123
/// Gets a <see cref="Task"/> that will transition to a completed state with the last transition of this source, i.e. into <see cref="
State
.Completed"/>.
150
State
state = _state;
153
if (state ==
State
.Completed)
160
if (state ==
State
.Ready && !_hasWaiter && final)
163
state =
State
.None;
168
if (state is
State
.None or
State
.Awaiting)
170
_state = final ?
State
.Completed :
State
.Ready;
178
if (state is
State
.None or
State
.Awaiting)
185
if (state is
State
.None or
State
.Awaiting)
196
if (state !=
State
.Ready)
204
return state !=
State
.Ready;
218
/// Tries to transition from <see cref="
State
.Awaiting"/> to either <see cref="
State
.Ready"/> or <see cref="
State
.Completed"/>, depending on the value of <paramref name="final"/>.
221
/// <param name="final">Whether this is the final transition to <see cref="
State
.Completed" /> or just a transition into <see cref="
State
.Ready"/> from which the task source can be reset back to <see cref="
State
.None"/>.</param>
229
/// Tries to transition from <see cref="
State
.Awaiting"/> to either <see cref="
State
.Ready"/> or <see cref="
State
.Completed"/>, depending on the value of <paramref name="final"/>.
232
/// <param name="final">Whether this is the final transition to <see cref="
State
.Completed" /> or just a transition into <see cref="
State
.Ready"/> from which the task source can be reset back to <see cref="
State
.None"/>.</param>
257
State
state = _state;
262
if (state ==
State
.Ready)
265
_state =
State
.None;
270
_state =
State
.Completed;
283
_state =
State
.None;