1 write to _state
System.Web (1)
AspNetSynchronizationContext.cs (1)
26
_state
= state;
26 references to _state
System.Web (26)
AspNetSynchronizationContext.cs (26)
31
return
_state
.AllowAsyncDuringSyncStages;
34
_state
.AllowAsyncDuringSyncStages = value;
43
get { return
_state
.Enabled; }
47
get { return
_state
.Helper.Error; }
51
get { return
_state
.Helper.PendingCount; }
55
_state
.AllowVoidAsyncOperations = true;
60
IDisposable disassociationAction =
_state
.Helper.EnterSynchronousControl();
73
_state
.SyncControlDisassociationActions.Push(disassociationAction);
77
_state
.Helper.Error = null;
83
return new AspNetSynchronizationContext(
_state
);
87
_state
.Enabled = false;
94
Debug.Assert(
_state
.SyncControlDisassociationActions.Count > 0, "DisassociateFromCurrentThread() was called on a thread which hadn't previously called AssociateWithCurrentThread().");
95
IDisposable disassociationAction =
_state
.SyncControlDisassociationActions.Pop();
100
_state
.Enabled = true;
104
Interlocked.Decrement(ref
_state
.VoidAsyncOutstandingOperationCount); // this line goes first since ChangeOperationCount might invoke a callback which depends on this value
105
_state
.Helper.ChangeOperationCount(-1);
111
if (!AllowAsyncDuringSyncStages && !
_state
.AllowVoidAsyncOperations) {
116
_state
.Helper.ChangeOperationCount(+1);
117
Interlocked.Increment(ref
_state
.VoidAsyncOutstandingOperationCount);
126
return
_state
.Helper.TrySetCompletionContinuation(() => callback(null));
130
_state
.Helper.QueueAsynchronous(() => callback(state));
135
_state
.Helper.QueueAsynchronousAsync(callback, state);
139
_state
.AllowVoidAsyncOperations = false;
151
if (!AllowAsyncDuringSyncStages && Volatile.Read(ref
_state
.VoidAsyncOutstandingOperationCount) > 0) {
153
_state
.Helper.Error = ExceptionDispatchInfo.Capture(ex);
168
_state
.Helper.QueueSynchronous(() => callback(state));