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