25 references to State
System.Net.Sockets (25)
System\Net\Sockets\SocketAsyncContext.Unix.cs (25)
144
_state = (int)
State
.Waiting;
157
int oldState = Interlocked.CompareExchange(ref _state, (int)
State
.Running, (int)
State
.Waiting);
158
if (oldState == (int)
State
.Canceled)
164
Debug.Assert(oldState == (int)
State
.Waiting, $"Unexpected operation state: {(
State
)oldState}");
169
Debug.Assert((
State
)Volatile.Read(ref _state) is
State
.Running or
State
.RunningWithPendingCancellation, "Unexpected operation state");
171
Volatile.Write(ref _state, (int)
State
.Complete);
182
Debug.Assert(state is (int)
State
.Running or (int)
State
.RunningWithPendingCancellation, $"Unexpected operation state: {(
State
)state}");
184
newState = (state == (int)
State
.Running ? (int)
State
.Waiting : (int)
State
.Canceled);
193
if (newState == (int)
State
.Canceled)
215
if (state is (int)
State
.Complete or (int)
State
.Canceled or (int)
State
.RunningWithPendingCancellation)
220
newState = (state == (int)
State
.Waiting ? (int)
State
.Canceled : (int)
State
.RunningWithPendingCancellation);
229
if (newState == (int)
State
.RunningWithPendingCancellation)
246
Debug.Assert(_state == (int)
State
.Canceled);