4 instantiations of ExecutionContext
System.Private.CoreLib (4)
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (4)
22internal static readonly ExecutionContext Default = new ExecutionContext(); 90(s_defaultFlowSuppressed ??= new ExecutionContext(AsyncLocalValueMap.Empty, new IAsyncLocal[0], isFlowSuppressed: true)) : 95return new ExecutionContext(m_localValues, m_localChangeNotifications, isFlowSuppressed); 531new ExecutionContext(newValues, newChangeNotifications, isFlowSuppressed);
309 references to ExecutionContext
Aspire.Dashboard (4)
Otlp\Storage\Subscription.cs (3)
14private readonly ExecutionContext? _executionContext; 30public Subscription(string name, ApplicationKey? applicationKey, SubscriptionType subscriptionType, Func<Task> callback, Action unsubscribe, ExecutionContext? executionContext, TelemetryRepository telemetryRepository) 98ExecutionContext.Restore(_executionContext);
Otlp\Storage\TelemetryRepository.cs (1)
278}, ExecutionContext.Capture(), this);
Aspire.Dashboard.Tests (1)
TelemetryRepositoryTests\LogTests.cs (1)
584using (ExecutionContext.SuppressFlow())
AzureFunctionsEndToEnd.Functions (1)
artifacts\obj\AzureFunctionsEndToEnd.Functions\Debug\net8.0\AzureFunctionsEndToEnd.Functions.GlobalUsings.g.cs (1)
9global using ExecutionContext = global::System.Threading.ExecutionContext;
Microsoft.AspNetCore.Components.WebView.Photino (5)
PhotinoSynchronizationContext.cs (5)
227ExecutionContext executionContext = null; 228if (!ExecutionContext.IsFlowSuppressed()) 230executionContext = ExecutionContext.Capture(); 288ExecutionContext.Run(item.ExecutionContext, ExecutionContextThunk, item); 320public ExecutionContext ExecutionContext;
Microsoft.AspNetCore.Http.Connections (3)
src\Shared\NonCapturingTimer\NonCapturingTimer.cs (3)
24if (!ExecutionContext.IsFlowSuppressed()) 26ExecutionContext.SuppressFlow(); 37ExecutionContext.RestoreFlow();
Microsoft.AspNetCore.Server.Kestrel.Core (4)
Internal\BaseHttpConnectionContext.cs (1)
50public ExecutionContext? InitialExecutionContext { get; set; }
Internal\Http\HttpProtocol.cs (2)
636_context.InitialExecutionContext = ExecutionContext.Capture(); 643ExecutionContext.Restore(_context.InitialExecutionContext);
Internal\Http2\Http2Connection.cs (1)
163_context.InitialExecutionContext = ExecutionContext.Capture();
Microsoft.AspNetCore.Shared.Tests (3)
src\Shared\NonCapturingTimer\NonCapturingTimer.cs (3)
24if (!ExecutionContext.IsFlowSuppressed()) 26ExecutionContext.SuppressFlow(); 37ExecutionContext.RestoreFlow();
Microsoft.AspNetCore.SignalR.Client.Core (3)
src\Shared\NonCapturingTimer\NonCapturingTimer.cs (3)
24if (!ExecutionContext.IsFlowSuppressed()) 26ExecutionContext.SuppressFlow(); 37ExecutionContext.RestoreFlow();
Microsoft.AspNetCore.SignalR.StackExchangeRedis (3)
src\Shared\NonCapturingTimer\NonCapturingTimer.cs (3)
24if (!ExecutionContext.IsFlowSuppressed()) 26ExecutionContext.SuppressFlow(); 37ExecutionContext.RestoreFlow();
Microsoft.AspNetCore.TestHost (2)
TestServer.cs (1)
137/// Gets or sets a value that controls if <see cref="ExecutionContext"/> and <see cref="AsyncLocal{T}"/> values are preserved from the client to the server. The default value is <see langword="false" />.
TestServerOptions.cs (1)
19/// Gets or sets a value that controls if <see cref="ExecutionContext"/> and <see cref="AsyncLocal{T}"/> values are preserved from the client to the server. The default value is <see langword="false" />.
Microsoft.CodeAnalysis.Workspaces (2)
Utilities\FlowControlHelper.cs (2)
13=> new(ExecutionContext.IsFlowSuppressed() ? default : ExecutionContext.SuppressFlow());
Microsoft.Extensions.Diagnostics.HealthChecks (3)
src\Shared\NonCapturingTimer\NonCapturingTimer.cs (3)
24if (!ExecutionContext.IsFlowSuppressed()) 26ExecutionContext.SuppressFlow(); 37ExecutionContext.RestoreFlow();
Microsoft.Extensions.FileProviders.Physical (3)
src\libraries\Common\src\Extensions\NonCapturingTimer\NonCapturingTimer.cs (3)
22if (!ExecutionContext.IsFlowSuppressed()) 24ExecutionContext.SuppressFlow(); 35ExecutionContext.RestoreFlow();
Microsoft.Extensions.Http (3)
src\libraries\Common\src\Extensions\NonCapturingTimer\NonCapturingTimer.cs (3)
22if (!ExecutionContext.IsFlowSuppressed()) 24ExecutionContext.SuppressFlow(); 35ExecutionContext.RestoreFlow();
Microsoft.Extensions.ServiceDiscovery (9)
Http\HttpServiceEndpointResolver.cs (3)
85if (!ExecutionContext.IsFlowSuppressed()) 87ExecutionContext.SuppressFlow(); 98ExecutionContext.RestoreFlow();
ServiceEndpointResolver.cs (3)
93if (!ExecutionContext.IsFlowSuppressed()) 95ExecutionContext.SuppressFlow(); 106ExecutionContext.RestoreFlow();
ServiceEndpointWatcher.cs (3)
108if (!ExecutionContext.IsFlowSuppressed()) 110ExecutionContext.SuppressFlow(); 120ExecutionContext.RestoreFlow();
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1129[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ExecutionContext))]
netstandard (1)
netstandard.cs (1)
2078[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ExecutionContext))]
ScenarioTests.Common.Tests (5)
ScenarioTestTypes.cs (5)
189if (ExecutionContext.IsFlowSuppressed()) 195var ec = ExecutionContext.Capture(); 199var s = ((SendOrPostCallback d, object state, ExecutionContext ec))obj; 200ExecutionContext.Run(s.ec, new ContextCallback(d), s.state);
System.Data.Odbc (3)
src\libraries\Common\src\System\Data\Common\AdapterUtil.Drivers.cs (3)
18if (!ExecutionContext.IsFlowSuppressed()) 20ExecutionContext.SuppressFlow(); 30ExecutionContext.RestoreFlow();
System.IO.Pipelines (6)
System\IO\Pipelines\CompletionData.cs (2)
12public ExecutionContext? ExecutionContext { get; } 15public CompletionData(Action<object?> completion, object? completionState, ExecutionContext? executionContext, SynchronizationContext? synchronizationContext)
System\IO\Pipelines\Pipe.cs (1)
869ExecutionContext.Run(completionData.ExecutionContext, s_executionContextRawCallback, state);
System\IO\Pipelines\PipeAwaitable.cs (3)
91ExecutionContext? executionContext = schedulingContext?.ExecutionContext; 143_schedulingContext.ExecutionContext = ExecutionContext.Capture(); 207public ExecutionContext? ExecutionContext { get; set; }
System.Net.Http (6)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
738using (ExecutionContext.SuppressFlow())
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (2)
233using (ExecutionContext.SuppressFlow()) 262using (ExecutionContext.SuppressFlow())
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (1)
100using (ExecutionContext.SuppressFlow())
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (2)
94using (ExecutionContext.SuppressFlow()) // Don't capture the current ExecutionContext and its AsyncLocals onto the timer causing them to live forever 186using (ExecutionContext.SuppressFlow())
System.Net.Mail (14)
src\libraries\Common\src\System\Net\ContextAwareResult.cs (12)
24private readonly ExecutionContext? _savedContext; 26internal CallbackClosure(ExecutionContext context, AsyncCallback? callback) 60internal ExecutionContext? Context 85private volatile ExecutionContext? _context; 127internal ExecutionContext? ContextCopy 137ExecutionContext? context = _context; 205ExecutionContext? cachedContext = null; 223ExecutionContext? cachedContext; 268private bool CaptureOrComplete(ref ExecutionContext? cachedContext, bool returnContext) 290cachedContext ??= ExecutionContext.Capture(); 350ExecutionContext? context = _context; 361ExecutionContext.Run(context, s => ((ContextAwareResult)s!).CompleteCallback(), this);
System\Net\Mail\SmtpConnection.cs (2)
314ExecutionContext? x = context?.ContextCopy; 320ExecutionContext.Run(x, s_AuthenticateCallback, authenticationContext);
System.Net.NetworkInformation (18)
System\Net\NetworkInformation\NetworkAddressChange.cs (4)
13private static readonly Dictionary<NetworkAddressChangedEventHandler, ExecutionContext?> s_addressChangedSubscribers = 14new Dictionary<NetworkAddressChangedEventHandler, ExecutionContext?>(); 17private static readonly Dictionary<NetworkAvailabilityChangedEventHandler, ExecutionContext?> s_availabilityChangedSubscribers = 18new Dictionary<NetworkAvailabilityChangedEventHandler, ExecutionContext?>();
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (14)
62s_addressChangedSubscribers.TryAdd(value, ExecutionContext.Capture()); 107using (ExecutionContext.SuppressFlow()) 113s_availabilityChangedSubscribers.TryAdd(value, ExecutionContext.Capture()); 169using (ExecutionContext.SuppressFlow()) 264Dictionary<NetworkAddressChangedEventHandler, ExecutionContext?>? addressChangedSubscribers = null; 270addressChangedSubscribers = new Dictionary<NetworkAddressChangedEventHandler, ExecutionContext?>(s_addressChangedSubscribers); 276foreach (KeyValuePair<NetworkAddressChangedEventHandler, ExecutionContext?> 280ExecutionContext? ec = subscriber.Value; 288ExecutionContext.Run(ec, s_runAddressChangedHandler, handler); 296Dictionary<NetworkAvailabilityChangedEventHandler, ExecutionContext?>? availabilityChangedSubscribers = null; 306new Dictionary<NetworkAvailabilityChangedEventHandler, ExecutionContext?>( 318foreach (KeyValuePair<NetworkAvailabilityChangedEventHandler, ExecutionContext?> 322ExecutionContext? ec = subscriber.Value; 330ExecutionContext.Run(ec, callbackContext, handler);
System.Net.Requests (12)
src\libraries\Common\src\System\Net\ContextAwareResult.cs (12)
24private readonly ExecutionContext? _savedContext; 26internal CallbackClosure(ExecutionContext context, AsyncCallback? callback) 60internal ExecutionContext? Context 85private volatile ExecutionContext? _context; 127internal ExecutionContext? ContextCopy 137ExecutionContext? context = _context; 205ExecutionContext? cachedContext = null; 223ExecutionContext? cachedContext; 268private bool CaptureOrComplete(ref ExecutionContext? cachedContext, bool returnContext) 290cachedContext ??= ExecutionContext.Capture(); 350ExecutionContext? context = _context; 361ExecutionContext.Run(context, s => ((ContextAwareResult)s!).CompleteCallback(), this);
System.Net.Sockets (6)
System\Net\Sockets\SocketAsyncEventArgs.cs (6)
73private ExecutionContext? _context; 564_context = ExecutionContext.Capture(); 661ExecutionContext? context = _context; // store context before it's cleared as part of finishing the operation 671ExecutionContext.Run(context, s_executionCallback, this); 1025ExecutionContext? context = _context; // store context before it's cleared as part of finishing the operation 1036ExecutionContext.Run(context, s_executionCallback, this);
System.Private.CoreLib (149)
src\libraries\Common\src\System\TimeProvider.cs (2)
156/// <see cref="CreateTimer"/> captures the <see cref="ExecutionContext"/> and stores that with the <see cref="ITimer"/> for use in invoking <paramref name="callback"/> 157/// each time it's called. That capture can be suppressed with <see cref="ExecutionContext.SuppressFlow"/>.
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.ThreadPoolValueTaskSource.cs (3)
35private ExecutionContext? _context; 161ExecutionContext.RunForThreadPoolUnsafe(_context, static x => x.ExecuteInternal(), this); 167_context = ExecutionContext.Capture();
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (4)
644private ExecutionContext? _context; 678_context = ExecutionContext.Capture(); 700ExecutionContext? context = _context; 714ExecutionContext.RunInternal(context, invokeAsyncCallback, this);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncIteratorMethodBuilder.cs (1)
26/// <summary>Invokes <see cref="IAsyncStateMachine.MoveNext"/> on the state machine while guarding the <see cref="ExecutionContext"/>.</summary>
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (3)
33ExecutionContext? previousExecutionCtx = currentThread._executionContext; 49ExecutionContext? currentExecutionCtx = currentThread._executionContext; 52ExecutionContext.RestoreChangedContextToThread(currentThread, previousExecutionCtx, currentExecutionCtx);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (8)
158ExecutionContext? currentContext = ExecutionContext.Capture(); 338public ref ExecutionContext? Context 342Debug.Assert(m_stateObject is null or ExecutionContext, $"Expected {nameof(m_stateObject)} to be null or an ExecutionContext but was {(m_stateObject is object o ? o.GetType().ToString() : "(null)")}."); 343return ref Unsafe.As<object?, ExecutionContext?>(ref m_stateObject); 362ExecutionContext? context = Context; 372ExecutionContext.RunInternal(context, s_callback, this); 376ExecutionContext.RunFromThreadPoolDispatchLoop(threadPoolThread, context, s_callback, this);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (5)
157ExecutionContext? currentContext = ExecutionContext.Capture(); 242public ExecutionContext? Context; 404ExecutionContext? context = Context; 413ExecutionContext.RunInternal(context, s_callback, this);
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (2)
35object? value = ExecutionContext.GetLocalValue(this); 45ExecutionContext.SetLocalValue(this, value, _valueChangedHandler is not null);
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationToken.cs (8)
125/// The current <see cref="ExecutionContext">ExecutionContext</see>, if one exists, will be captured 146/// The current <see cref="ExecutionContext">ExecutionContext</see>, if one exists, will be captured 178/// The current <see cref="ExecutionContext">ExecutionContext</see>, if one exists, will be captured 193/// generates will be propagated out of this method call. The current <see cref="ExecutionContext">ExecutionContext</see>, if one exists, 214/// The current <see cref="ExecutionContext">ExecutionContext</see>, if one exists, 241/// <see cref="ExecutionContext">ExecutionContext</see> is not captured nor flowed 256/// generates will be propagated out of this method call. <see cref="ExecutionContext"/> is not captured nor flowed to the callback's invocation. 293source.Register(callback, state, useSynchronizationContext ? SynchronizationContext.Current : null, useExecutionContext ? ExecutionContext.Capture() : null) :
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (8)
218using (ExecutionContext.SuppressFlow()) 243/// The <see cref="ExecutionContext"/> that was captured when each callback was registered 268/// The <see cref="ExecutionContext"/> that was captured when each callback was registered 300/// The <see cref="ExecutionContext"/> that was captured when each callback was registered 587Delegate callback, object? stateForCallback, SynchronizationContext? syncContext, ExecutionContext? executionContext) 1202public ExecutionContext? ExecutionContext; 1213ExecutionContext? context = ExecutionContext; 1221ExecutionContext.RunInternal(context, static s =>
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (30)
22internal static readonly ExecutionContext Default = new ExecutionContext(); 23private static ExecutionContext? s_defaultFlowSuppressed; 52public static ExecutionContext? Capture() 54ExecutionContext? executionContext = Thread.CurrentThread._executionContext; 68internal static ExecutionContext? CaptureForRestore() 82private ExecutionContext? ShallowClone(bool isFlowSuppressed) 101ExecutionContext? executionContext = currentThread._executionContext ?? Default; 116ExecutionContext? executionContext = currentThread._executionContext; 127ExecutionContext? executionContext = Thread.CurrentThread._executionContext; 135public static void Run(ExecutionContext executionContext, ContextCallback callback, object? state) 146internal static void RunInternal(ExecutionContext? executionContext, ContextCallback callback, object? state) 155ExecutionContext? previousExecutionCtx0 = currentThread._executionContext; 162ExecutionContext? previousExecutionCtx = previousExecutionCtx0; 196ExecutionContext? currentExecutionCtx = currentThread._executionContext; 215public static void Restore(ExecutionContext executionContext) 225internal static void RestoreInternal(ExecutionContext? executionContext) 229ExecutionContext? currentExecutionCtx = currentThread._executionContext; 248internal static void RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, object state) 277ExecutionContext? currentExecutionCtx = currentThread._executionContext; 292internal static void RunForThreadPoolUnsafe<TState>(ExecutionContext executionContext, Action<TState> callback, in TState state) 312internal static void RestoreChangedContextToThread(Thread currentThread, ExecutionContext? contextToRestore, ExecutionContext? currentContext) 331ExecutionContext? currentExecutionCtx = currentThread._executionContext; 355internal static void OnValuesChanged(ExecutionContext? previousExecutionCtx, ExecutionContext? nextExecutionCtx) 450ExecutionContext? current = Thread.CurrentThread._executionContext; 464ExecutionContext? current = Thread.CurrentThread._executionContext; 539public ExecutionContext CreateCopy() 582if (!ExecutionContext.IsFlowSuppressed()) 588ExecutionContext.RestoreFlow();
src\libraries\System.Private.CoreLib\src\System\Threading\IOCompletionCallbackHelper.cs (3)
12private readonly ExecutionContext _executionContext; 17public IOCompletionCallbackHelper(IOCompletionCallback ioCompletionCallback, ExecutionContext executionContext) 57ExecutionContext.RunInternal(helper._executionContext, IOCompletionCallback_Context_Delegate, helper);
src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (2)
83ExecutionContext? ec = ExecutionContext.Capture();
src\libraries\System.Private.CoreLib\src\System\Threading\PeriodicTimer.cs (1)
73using (ExecutionContext.SuppressFlow())
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs (16)
130_capturedContext = ExecutionContext.Capture(); 140new CapturedSchedulerAndExecutionContext(sc, (ExecutionContext)_capturedContext); 149new CapturedSchedulerAndExecutionContext(ts, (ExecutionContext)_capturedContext); 189case ExecutionContext: 238else if (context is ExecutionContext or CapturedSchedulerAndExecutionContext) 255internal readonly ExecutionContext _executionContext; 257public CapturedSchedulerAndExecutionContext(object scheduler, ExecutionContext executionContext) 320Debug.Assert(capturedContext is ExecutionContext or CapturedSchedulerAndExecutionContext, $"{nameof(capturedContext)} is {capturedContext}"); 323ExecutionContext? currentContext = ExecutionContext.CaptureForRestore(); 325if (capturedContext is ExecutionContext ec) 327ExecutionContext.RestoreInternal(ec); // Restore the captured ExecutionContext before executing anything. 336ExecutionContext.RestoreInternal(currentContext); // Restore the current ExecutionContext. 361ExecutionContext.RestoreInternal(currentContext); 371ExecutionContext.Restore(cc._executionContext); // Restore the captured ExecutionContext before executing anything. 378ExecutionContext.RestoreInternal(currentContext); // Restore the current ExecutionContext.
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (10)
222internal ExecutionContext? m_capturedContext; // The execution context to run the task within, if any. Only set from non-concurrent contexts. 521CapturedContext = ExecutionContext.Capture(); 1531internal ExecutionContext? CapturedContext 1541return m_contingentProperties?.m_capturedContext ?? ExecutionContext.Default; 1551else if (value != ExecutionContext.Default) // not the default context, then inflate the contingent properties and set it 2330ExecutionContext? ec = CapturedContext; 2341ExecutionContext.RunInternal(ec, s_ecCallback, this); 2345ExecutionContext.RunFromThreadPoolDispatchLoop(threadPoolThread, ec, s_ecCallback, this); 2888using (ExecutionContext.SuppressFlow()) 5813using (ExecutionContext.SuppressFlow())
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (7)
523private readonly ExecutionContext? m_capturedContext; 538m_capturedContext = ExecutionContext.Capture(); 623ExecutionContext? context = m_capturedContext; 642ExecutionContext.CheckThreadPoolAndContextsAreDefault(); 652ExecutionContext.RunForThreadPoolUnsafe(context, s_invokeAction, m_action); 693ExecutionContext? context = m_capturedContext; 702ExecutionContext.RunInternal(context, callback, state);
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (6)
32internal ExecutionContext? _executionContext; 52ExecutionContext.RunInternal(_executionContext, s_threadStartContextCallback, this); 232startHelper._executionContext = captureContext ? ExecutionContext.Capture() : null; 268startHelper._executionContext = captureContext ? ExecutionContext.Capture() : null; 394public ExecutionContext? ExecutionContext => ExecutionContext.Capture();
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolBoundHandle.Unix.cs (1)
160/// <see cref="ExecutionContext"/> is not flowed to the invocation of the callback.
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (17)
1163ExecutionContext.ResetThreadPoolThread(currentThread); 1494private readonly ExecutionContext _context; 1505internal QueueUserWorkItemCallback(WaitCallback callback, object? state, ExecutionContext context) 1518ExecutionContext.RunForThreadPoolUnsafe(_context, s_executionContextShim, this); 1526private readonly ExecutionContext _context; 1528internal QueueUserWorkItemCallback(Action<TState> callback, TState state, ExecutionContext context) 1545ExecutionContext.RunForThreadPoolUnsafe(_context, callback, in _state); 1564ExecutionContext.CheckThreadPoolAndContextsAreDefault(); 1592ExecutionContext.CheckThreadPoolAndContextsAreDefault(); 1608private readonly ExecutionContext? _executionContext; 1621_executionContext = ExecutionContext.Capture(); 1642ExecutionContext? context = helper._executionContext; 1650ExecutionContext.Run(context, timedOut ? _ccbt : _ccbf, helper); 1841ExecutionContext? context = ExecutionContext.Capture(); 1859ExecutionContext? context = ExecutionContext.Capture();
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (5)
478private readonly ExecutionContext? _executionContext; 512_executionContext = ExecutionContext.Capture(); 720ExecutionContext? context = _executionContext; 729ExecutionContext.RunFromThreadPoolDispatchLoop(Thread.CurrentThread, context, s_callCallbackInContext, this); 733ExecutionContext.RunInternal(context, s_callCallbackInContext, this);
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (2)
123data._executionContext = flowExecutionContext ? ExecutionContext.Capture() : null; 213ExecutionContext.Run(data._executionContext, callback, args);
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.OverlappedData.cs (1)
16internal ExecutionContext? _executionContext;
src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (3)
21public ExecutionContext? _previousExecutionCtx; 41ExecutionContext? currentExecutionCtx = _thread._executionContext; 44ExecutionContext.RestoreChangedContextToThread(_thread, _previousExecutionCtx, currentExecutionCtx);
src\System\Threading\Thread.CoreCLR.cs (1)
30internal ExecutionContext? _executionContext; // this call context follows the logical thread
System.Runtime.Caching (6)
System\Runtime\Caching\CacheExpires.cs (3)
851if (!ExecutionContext.IsFlowSuppressed()) 853ExecutionContext.SuppressFlow(); 864ExecutionContext.RestoreFlow();
System\Runtime\Caching\MemoryCacheStatistics.cs (3)
176if (!ExecutionContext.IsFlowSuppressed()) 178ExecutionContext.SuppressFlow(); 188ExecutionContext.RestoreFlow();
System.ServiceModel.UnixDomainSocket (11)
System\ServiceModel\Channels\SocketConnection.cs (11)
182if (!ExecutionContext.IsFlowSuppressed()) 184ExecutionContext.SuppressFlow(); 192ExecutionContext.RestoreFlow(); 219ExecutionContext.RestoreFlow(); 264if (!ExecutionContext.IsFlowSuppressed()) 266ExecutionContext.SuppressFlow(); 274ExecutionContext.RestoreFlow(); 303ExecutionContext.RestoreFlow(); 730if (!ExecutionContext.IsFlowSuppressed()) 732ExecutionContext.SuppressFlow(); 743ExecutionContext.RestoreFlow();
System.Threading (6)
artifacts\obj\System.Threading\Debug\net10.0\System.Threading.Forwards.cs (1)
11[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ExecutionContext))]
System\Threading\Barrier.cs (3)
136private readonly ExecutionContext? _ownerThreadContext; 233_ownerThreadContext = ExecutionContext.Capture(); 777ExecutionContext.Run(_ownerThreadContext, handler, this);
System\Threading\HostExecutionContextManager.cs (2)
9/// Normally, the current <see cref="HostExecutionContext"/> would be stored on the <see cref="ExecutionContext"/>. 11/// separating itself from the <see cref="ExecutionContext"/> to minimize unnecessary additions there.
System.Threading.Channels (3)
System\Threading\Channels\AsyncOperation.cs (3)
71private ExecutionContext? _executionContext; 224_executionContext = ExecutionContext.Capture(); 439ExecutionContext.Run(_executionContext, static s =>
System.Threading.RateLimiting (3)
System\Threading\RateLimiting\TimerAwaitable.cs (3)
49if (!ExecutionContext.IsFlowSuppressed()) 51ExecutionContext.SuppressFlow(); 69ExecutionContext.RestoreFlow();
System.Threading.Tasks.Parallel (5)
System\Threading\Tasks\Parallel.ForEachAsync.cs (5)
522/// <summary>The <see cref="ExecutionContext"/> present at the time of the ForEachAsync invocation. This is only used if on the default scheduler.</summary> 523private readonly ExecutionContext? _executionContext; 549_executionContext = ExecutionContext.Capture(); 668/// <summary>Executes the task body using the <see cref="ExecutionContext"/> captured when ForEachAsync was invoked.</summary> 679ExecutionContext.Run(_executionContext, static o => ((ForEachAsyncState<TSource>)o!)._taskBody(o), this);
System.Windows.Forms (5)
System\Windows\Forms\Control.cs (3)
6011ExecutionContext.Run(tme._executionContext, s_invokeMarshaledCallbackHelperDelegate, tme); 6414ExecutionContext? executionContext = null; 6417executionContext = ExecutionContext.Capture();
System\Windows\Forms\Control.ThreadMethodEntry.cs (2)
25internal ExecutionContext? _executionContext; 37ExecutionContext? executionContext)