4 instantiations of ExecutionContext
System.Private.CoreLib (4)
309 references to ExecutionContext
Aspire.Dashboard (4)
Aspire.Dashboard.Tests (1)
AzureFunctionsEndToEnd.Functions (1)
Microsoft.AspNetCore.Components.WebView.Photino (5)
Microsoft.AspNetCore.Http.Connections (3)
Microsoft.AspNetCore.Server.Kestrel.Core (4)
Microsoft.AspNetCore.Shared.Tests (3)
Microsoft.AspNetCore.SignalR.Client.Core (3)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (3)
Microsoft.AspNetCore.TestHost (2)
Microsoft.CodeAnalysis.Workspaces (2)
Microsoft.Extensions.Diagnostics.HealthChecks (3)
Microsoft.Extensions.FileProviders.Physical (3)
Microsoft.Extensions.Http (3)
Microsoft.Extensions.ServiceDiscovery (9)
mscorlib (1)
netstandard (1)
ScenarioTests.Common.Tests (5)
System.Data.Odbc (3)
System.IO.Pipelines (6)
System.Net.Http (6)
System.Net.Mail (14)
System.Net.NetworkInformation (18)
System.Net.Requests (12)
System.Net.Sockets (6)
System.Private.CoreLib (149)
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\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\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();
System.Runtime.Caching (6)
System.ServiceModel.UnixDomainSocket (11)
System.Threading (6)
System.Threading.Channels (3)
System.Threading.RateLimiting (3)
System.Threading.Tasks.Parallel (5)
System.Windows.Forms (5)