net\System\Net\_ContextAwareResult.cs (24)
91private StateFlags _Flags;
116_Flags = StateFlags.CaptureContext;
121_Flags |= StateFlags.CaptureIdentity;
126_Flags |= StateFlags.ThreadSafeContextCopy;
161GlobalLog.Assert(AsyncCallback != null || (_Flags & StateFlags.CaptureContext) != 0, "ContextAwareResult#{0}::ContextCopy|No context captured - specify a callback or forceCaptureContext.", ValidationHelper.HashString(this));
165if ((_Flags & StateFlags.PostBlockFinished) == 0)
189GlobalLog.Assert(!InternalPeekCompleted || (_Flags & StateFlags.ThreadSafeContextCopy) != 0, "ContextAwareResult#{0}::Identity|Called on completed result.", ValidationHelper.HashString(this));
201GlobalLog.Assert((_Flags & StateFlags.CaptureIdentity) != 0, "ContextAwareResult#{0}::Identity|No identity captured - specify captureIdentity.", ValidationHelper.HashString(this));
205if ((_Flags & StateFlags.PostBlockFinished) == 0)
211GlobalLog.Assert(!InternalPeekCompleted || (_Flags & StateFlags.ThreadSafeContextCopy) != 0, "ContextAwareResult#{0}::Identity|Result became completed during call.", ValidationHelper.HashString(this));
251_Flags |= StateFlags.PostBlockStarted;
261if ((_Flags & (StateFlags.PostBlockStarted | StateFlags.PostBlockFinished)) != StateFlags.PostBlockStarted)
265_Flags |= StateFlags.PostBlockFinished;
278if ((_Flags & (StateFlags.PostBlockStarted | StateFlags.PostBlockFinished)) != StateFlags.PostBlockStarted)
282_Flags |= StateFlags.PostBlockFinished;
364GlobalLog.Assert((_Flags & StateFlags.PostBlockStarted) != 0, "ContextAwareResult#{0}::CaptureOrComplete|Called without calling StartPostingAsyncOp.", ValidationHelper.HashString(this));
367bool capturingContext = AsyncCallback != null || (_Flags & StateFlags.CaptureContext) != 0;
373if ((_Flags & StateFlags.CaptureIdentity) != 0 && !InternalPeekCompleted &&
435if ((_Flags & StateFlags.PostBlockStarted) == 0)
461ExecutionContext.Run((_Flags & StateFlags.ThreadSafeContextCopy) != 0 ? context.CreateCopy() : context,