6 instantiations of ExecutionContext
mscorlib (6)
system\threading\executioncontext.cs (5)
556private static readonly ExecutionContext s_dummyDefaultEC = new ExecutionContext(isPreAllocatedDefault: true); 973executionContext = new ExecutionContext(); 1097ExecutionContext ec = new ExecutionContext(); 1132ExecutionContext ec = new ExecutionContext(); 1307ExecutionContext ecNew = new ExecutionContext();
system\threading\thread.cs (1)
408m_ExecutionContext = new ExecutionContext();
224 references to ExecutionContext
mscorlib (150)
system\io\stream.cs (6)
620private ExecutionContext _context; 658_context = ExecutionContext.Capture(ref stackMark, 659ExecutionContext.CaptureOptions.OptimizeDefaultCase | ExecutionContext.CaptureOptions.IgnoreSyncCtx); 682var context = _context; 696using(context) ExecutionContext.Run(context, invokeAsyncCallback, this, true);
system\runtime\compilerservices\AsyncMethodBuilder.cs (8)
83ExecutionContext.EstablishCopyOnWriteScope(ref ecs); 315ExecutionContext.EstablishCopyOnWriteScope(ref ecs); 470ExecutionContext.EstablishCopyOnWriteScope(ref ecs); 916var capturedContext = ExecutionContext.FastCapture(); // ok to use FastCapture as we haven't made any permission demands/asserts 1042private readonly ExecutionContext m_context; 1049internal MoveNextRunner(ExecutionContext context, IAsyncStateMachine stateMachine) 1070ExecutionContext.Run(m_context, callback, m_stateMachine, preserveSyncCtx: true);
system\runtime\remoting\callcontext.cs (6)
44ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 56ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 99ExecutionContext.Reader ec = Thread.CurrentThread.GetExecutionContextReader(); 109ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 149ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 157ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext();
system\runtime\remoting\realproxy.cs (1)
956ExecutionContext ec = currentThread.GetMutableExecutionContext();
system\security\principal\windowsidentity.cs (1)
781ExecutionContext ec = currentThread.GetMutableExecutionContext();
system\security\securitycontext.cs (13)
64internal ExecutionContext currEC; // current ExecutionContext on Thread 172private ExecutionContext _executionContext; 227internal ExecutionContext ExecutionContext 297ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 356ExecutionContext.Reader ec = Thread.CurrentThread.GetExecutionContextReader(); 466ExecutionContext currEC = Thread.CurrentThread.GetMutableExecutionContext(); 566static internal SecurityContext Capture(ExecutionContext.Reader currThreadEC, ref StackCrawlMark stackMark) 580static private SecurityContext CaptureCore(ExecutionContext.Reader currThreadEC, ref StackCrawlMark stackMark) 631static internal WindowsIdentity GetCurrentWI(ExecutionContext.Reader threadEC) 640static internal WindowsIdentity GetCurrentWI(ExecutionContext.Reader threadEC, bool cachedAlwaysFlowImpersonationPolicy) 655static internal void RestoreCurrentWI(ExecutionContext.Reader currentEC, ExecutionContext.Reader prevEC, WindowsIdentity targetWI, bool cachedAlwaysFlowImpersonationPolicy) 700static internal bool CurrentlyInDefaultFTSecurityContext(ExecutionContext.Reader threadEC)
system\threading\asynclocal.cs (2)
69object obj = ExecutionContext.GetLocalValue(this); 75ExecutionContext.SetLocalValue(this, value, m_valueChangedHandler != null);
system\threading\CancellationToken.cs (7)
186/// The current <see cref="System.Threading.ExecutionContext">ExecutionContext</see>, if one exists, will be captured 218/// The current <see cref="System.Threading.ExecutionContext">ExecutionContext</see>, if one exists, will be captured 253/// The current <see cref="System.Threading.ExecutionContext">ExecutionContext</see>, if one exists, will be captured 286/// The current <see cref="System.Threading.ExecutionContext">ExecutionContext</see>, if one exists, 342ExecutionContext capturedExecutionContext = null; 348capturedExecutionContext = ExecutionContext.Capture( 349ref stackMark, ExecutionContext.CaptureOptions.OptimizeDefaultCase); // ideally we'd also use IgnoreSyncCtx, but that could break compat
system\threading\CancellationTokenSource.cs (4)
635Action<object> callback, object stateForCallback, SynchronizationContext targetSyncContext, ExecutionContext executionContext) 980internal readonly ExecutionContext TargetExecutionContext; 984Action<object> callback, object stateForCallback, SynchronizationContext targetSyncContext, ExecutionContext targetExecutionContext, 1011ExecutionContext.Run(
system\threading\compressedstack.cs (1)
405ExecutionContext ec = currentThread.GetMutableExecutionContext();
system\threading\executioncontext.cs (33)
288internal ExecutionContext.Reader outerEC; // previous EC we need to restore on Undo 350ExecutionContext.Reader innerEC = currentThread.GetExecutionContextReader(); 383ExecutionContext.OnAsyncLocalContextChanged(innerEC.DangerousGetRawExecutionContext(), outerEC.DangerousGetRawExecutionContext()); 391private ExecutionContext _ec; 439ExecutionContext.RestoreFlow(); 556private static readonly ExecutionContext s_dummyDefaultEC = new ExecutionContext(isPreAllocatedDefault: true); 558static internal ExecutionContext PreAllocatedDefault 597ExecutionContext m_ec; 599public Reader(ExecutionContext ec) { m_ec = ec; } 601public ExecutionContext DangerousGetRawExecutionContext() { return m_ec; } 612public bool IsSame(ExecutionContext.Reader other) { return m_ec == other.m_ec; } 655public bool HasSameLocalValues(ExecutionContext other) 678ExecutionContext current = Thread.CurrentThread.GetMutableExecutionContext(); 736internal static void OnAsyncLocalContextChanged(ExecutionContext previous, ExecutionContext current) 909public static void Run(ExecutionContext executionContext, ContextCallback callback, Object state) 925internal static void Run(ExecutionContext executionContext, ContextCallback callback, Object state, bool preserveSyncCtx) 935internal static void RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, bool preserveSyncCtx) 954ExecutionContext.Reader ec = currentThread.GetExecutionContextReader(); 1023internal static ExecutionContextSwitcher SetExecutionContext(ExecutionContext executionContext, bool preserveSyncCtx) 1036ExecutionContext.Reader outerEC = currentThread.GetExecutionContextReader(); 1091public ExecutionContext CreateCopy() 1097ExecutionContext ec = new ExecutionContext(); 1128internal ExecutionContext CreateMutableCopy() 1132ExecutionContext ec = new ExecutionContext(); 1182ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 1198public static ExecutionContext Capture() 1202return ExecutionContext.Capture(ref stackMark, CaptureOptions.None); 1212internal static ExecutionContext FastCapture() 1216return ExecutionContext.Capture(ref stackMark, CaptureOptions.IgnoreSyncCtx | CaptureOptions.OptimizeDefaultCase); 1234static internal ExecutionContext Capture(ref StackCrawlMark stackMark, CaptureOptions options) 1236ExecutionContext.Reader ecCurrent = Thread.CurrentThread.GetExecutionContextReader(); 1307ExecutionContext ecNew = new ExecutionContext();
system\threading\hostexecutioncontextmanager.cs (3)
33internal ExecutionContext executionContext; 209ExecutionContext currentExecutionContext = Thread.CurrentThread.GetMutableExecutionContext(); 250ExecutionContext executionContext = Thread.CurrentThread.GetMutableExecutionContext();
system\threading\overlapped.cs (6)
68ExecutionContext _executionContext; 84_executionContext = ExecutionContext.Capture( 86ExecutionContext.CaptureOptions.IgnoreSyncCtx | ExecutionContext.CaptureOptions.OptimizeDefaultCase); 129using (ExecutionContext executionContext = helper._executionContext.CreateCopy()) 130ExecutionContext.Run(executionContext, _ccb, helper, true);
system\threading\synchronizationcontext.cs (1)
242ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext();
system\threading\Tasks\Task.cs (13)
256internal ExecutionContext m_capturedContext; // The execution context to run the task within, if any. 783CapturedContext = ExecutionContext.Capture( 785ExecutionContext.CaptureOptions.IgnoreSyncCtx | ExecutionContext.CaptureOptions.OptimizeDefaultCase); 1755internal ExecutionContext CapturedContext 1767else return ExecutionContext.PreAllocatedDefault; 1790private static ExecutionContext CopyExecutionContext(ExecutionContext capturedContext) 1795return ExecutionContext.PreAllocatedDefault; 2604ExecutionContext creatorContext = root.CapturedContext; 2651ExecutionContext creatorContext = root.CapturedContext; 2801ExecutionContext ec = CapturedContext; 2823ExecutionContext.Run(ec, callback, this, true);
system\threading\Tasks\TaskContinuation.cs (7)
546private readonly ExecutionContext m_capturedContext; 563m_capturedContext = ExecutionContext.Capture( 565ExecutionContext.CaptureOptions.IgnoreSyncCtx | ExecutionContext.CaptureOptions.OptimizeDefaultCase); 579m_capturedContext = ExecutionContext.FastCapture(); 688ExecutionContext.Run(m_capturedContext, GetInvokeActionCallback(), m_action, true); 761else ExecutionContext.Run(m_capturedContext, callback, state, true);
system\threading\thread.cs (16)
48ExecutionContext _executionContext = null; 54internal void SetExecutionContextHelper(ExecutionContext ec) 87ExecutionContext.Run(_executionContext, _ccb, (Object)this); 105ExecutionContext.Run(_executionContext, _ccb, (Object)this); 139private ExecutionContext m_ExecutionContext; // this call context follows the logical thread 347ExecutionContext ec = ExecutionContext.Capture( 349ExecutionContext.CaptureOptions.IgnoreSyncCtx); 363internal ExecutionContext.Reader GetExecutionContextReader() 365return new ExecutionContext.Reader(m_ExecutionContext); 382public ExecutionContext ExecutionContext 388ExecutionContext result; 400internal ExecutionContext GetMutableExecutionContext() 412ExecutionContext copy = m_ExecutionContext.CreateMutableCopy(); 422internal void SetExecutionContext(ExecutionContext value, bool belongsToCurrentScope) 430internal void SetExecutionContext(ExecutionContext.Reader value, bool belongsToCurrentScope)
system\threading\threadpool.cs (15)
1188private ExecutionContext context; 1215if (compressStack && !ExecutionContext.IsFlowSuppressed()) 1218context = ExecutionContext.Capture( 1220ExecutionContext.CaptureOptions.IgnoreSyncCtx | ExecutionContext.CaptureOptions.OptimizeDefaultCase); 1227internal QueueUserWorkItemCallback(WaitCallback waitCallback, Object stateObj, ExecutionContext ec) 1250ExecutionContext.Run(context, ccb, this, true); 1283ExecutionContext _executionContext; 1296if (compressStack && !ExecutionContext.IsFlowSuppressed()) 1299_executionContext = ExecutionContext.Capture( 1301ExecutionContext.CaptureOptions.IgnoreSyncCtx | ExecutionContext.CaptureOptions.OptimizeDefaultCase); 1337using (ExecutionContext executionContext = helper._executionContext.CreateCopy()) 1340ExecutionContext.Run(executionContext, _ccbt, helper, true); 1342ExecutionContext.Run(executionContext, _ccbf, helper, true);
system\threading\timer.cs (7)
522readonly ExecutionContext m_executionContext; 545if (!ExecutionContext.IsFlowSuppressed()) 547m_executionContext = ExecutionContext.Capture( 549ExecutionContext.CaptureOptions.IgnoreSyncCtx | ExecutionContext.CaptureOptions.OptimizeDefaultCase); 706using (ExecutionContext executionContext = 713ExecutionContext.Run(
SMSvcHost (2)
System\ServiceModel\Activation\TransportListener.cs (2)
139if (ExecutionContext.IsFlowSuppressed()) 155using (ExecutionContext.SuppressFlow())
System (49)
net\System\Net\_ContextAwareResult.cs (12)
30private ExecutionContext savedContext; 32internal CallbackClosure(ExecutionContext context, AsyncCallback callback) 62internal ExecutionContext Context 89private volatile ExecutionContext _Context; 145internal ExecutionContext ContextCopy 154ExecutionContext context = _Context; 267ExecutionContext cachedContext = null; 286ExecutionContext cachedContext; 362private bool CaptureOrComplete(ref ExecutionContext cachedContext, bool returnContext) 388cachedContext = ExecutionContext.Capture(); 448ExecutionContext context = _Context; 461ExecutionContext.Run((_Flags & StateFlags.ThreadSafeContextCopy) != 0 ? context.CreateCopy() : context,
net\System\Net\_NTAuthentication.cs (2)
405ExecutionContext x = context == null ? null : context.ContextCopy; 412ExecutionContext.Run(x, s_InitializeCallback, new InitializeCallbackContext(this, isServer, package, credential, spn, requestedContextFlags, channelBinding));
net\System\Net\_TLSstream.cs (4)
28private ExecutionContext _ExecutionContext; 46ExecutionContext executionContext) : base(networkStream, true) { 55_ExecutionContext = ExecutionContext.Capture(); 491ExecutionContext.Run(_ExecutionContext.CreateCopy(), new ContextCallback(CallProcessAuthentication), handshakeResult);
net\System\Net\HttpWebRequest.cs (4)
3471ExecutionContext x = Async ? GetWritingContext().ContextCopy : null; 3478ExecutionContext.Run(x, new ContextCallback(CallContinueDelegateCallback), continueResponse); 5946ExecutionContext context = needExecutionContext ? GetReadingContext().ContextCopy : null; 5952ExecutionContext.Run(context, NclUtilities.ContextRelativeDemandCallback, permission);
net\System\Net\mail\smtpconnection.cs (2)
500ExecutionContext x = context == null ? null : context.ContextCopy; 506ExecutionContext.Run(x, s_AuthenticateCallback, authenticationContext);
net\System\Net\NetworkInformation\NetworkAddressChange.cs (8)
115ExecutionContext context = (ExecutionContext) entry.Value; 122ExecutionContext.Run(context.CreateCopy(), s_RunHandlerCallback, handler); 140s_availabilityCallerArray.Add(caller, ExecutionContext.Capture()); 217ExecutionContext context = (ExecutionContext) entry.Value; 224ExecutionContext.Run(context.CreateCopy(), s_runHandlerCallback, handler); 273s_callerArray.Add(caller, captureContext ? ExecutionContext.Capture() : null);
net\System\Net\Sockets\Socket.cs (8)
8672private ExecutionContext m_Context; 8673private ExecutionContext m_ContextCopy; 9016if (ExecutionContext.IsFlowSuppressed()) { 9040m_Context = ExecutionContext.Capture(); 9759ExecutionContext.Run(m_ContextCopy, m_ExecutionCallback, null); 9773ExecutionContext.Run(m_ContextCopy, m_ExecutionCallback, null); 9788ExecutionContext.Run(m_ContextCopy, m_ExecutionCallback, null); 10029ExecutionContext.Run(m_ContextCopy, m_ExecutionCallback, null);
net\System\Net\WebRequest.cs (2)
868if (ExecutionContext.IsFlowSuppressed() 905if (ExecutionContext.IsFlowSuppressed()
net\System\Net\WebSockets\WebSocketBase.cs (2)
2275if (ExecutionContext.IsFlowSuppressed()) 2284using (ExecutionContext.SuppressFlow())
sys\system\threading\Barrier.cs (5)
149ExecutionContext m_ownerThreadContext; 248if (postPhaseAction != null && !ExecutionContext.IsFlowSuppressed()) 250m_ownerThreadContext = ExecutionContext.Capture(); 793var currentContext = m_ownerThreadContext; 801ExecutionContext.Run(currentContext, handler, this);
System.Data (8)
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (2)
4713_stateObj._executionContext = ExecutionContext.Capture(); 4776_stateObj._executionContext = ExecutionContext.Capture();
fx\src\data\System\Data\SqlClient\SqlDependency.cs (3)
166private ExecutionContext _context; 175_context = ExecutionContext.Capture(); 205ExecutionContext.Run(_context, _contextCallback, this);
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (3)
194internal ExecutionContext _executionContext; 2503ExecutionContext.Run(_executionContext, (state) => source.TrySetResult(null), null); 2511ExecutionContext.Run(_executionContext, (state) => ReadAsyncCallbackCaptureException(source), null);
System.ServiceModel (4)
System\ServiceModel\Channels\SharedHttpTransportManager.cs (2)
136if (ExecutionContext.IsFlowSuppressed()) 142using (ExecutionContext.SuppressFlow())
System\ServiceModel\Channels\SocketConnection.cs (2)
1240if (!ExecutionContext.IsFlowSuppressed()) 1254using (ExecutionContext.SuppressFlow())
System.Web (6)
Util\ExecutionContextUtil.cs (6)
19private static readonly ExecutionContext s_dummyDefaultEC = GetDummyDefaultEC(); 22private static ExecutionContext GetDummyDefaultEC() { 24PropertyInfo propInfo = typeof(ExecutionContext).GetProperty("PreAllocatedDefault", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static); 27throw new Exception(SR.GetString(SR.Type_doesnt_have_property, typeof(ExecutionContext).FullName, "PreAllocatedDefault")); 30return (ExecutionContext) propInfo.GetValue(null, null); 37ExecutionContext.Run(s_dummyDefaultEC, s_actionToActionObjShunt, callback);
System.Windows.Forms (5)
winforms\Managed\System\WinForms\Control.cs (5)
7403ExecutionContext.Run(tme.executionContext, invokeMarshaledCallbackHelperDelegate, tme); 7814ExecutionContext executionContext = null; 7816executionContext = ExecutionContext.Capture(); 20049internal ExecutionContext executionContext; 20056internal ThreadMethodEntry(Control caller, Control marshaler, Delegate method, Object[] args, bool synchronous, ExecutionContext executionContext) {