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);
293 references to 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)
47public ExecutionContext? InitialExecutionContext { get; set; }
Internal\Http\HttpProtocol.cs (2)
631_context.InitialExecutionContext = ExecutionContext.Capture(); 638ExecutionContext.Restore(_context.InitialExecutionContext);
Internal\Http2\Http2Connection.cs (1)
144_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.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)
25if (!ExecutionContext.IsFlowSuppressed()) 27ExecutionContext.SuppressFlow(); 38ExecutionContext.RestoreFlow();
Microsoft.Extensions.Http (3)
src\libraries\Common\src\Extensions\NonCapturingTimer\NonCapturingTimer.cs (3)
25if (!ExecutionContext.IsFlowSuppressed()) 27ExecutionContext.SuppressFlow(); 38ExecutionContext.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)
188if (ExecutionContext.IsFlowSuppressed()) 194var ec = ExecutionContext.Capture(); 198var s = ((SendOrPostCallback d, object state, ExecutionContext ec))obj; 199ExecutionContext.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)
872ExecutionContext.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 (3)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
287using (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)
306ExecutionContext? x = context?.ContextCopy; 312ExecutionContext.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)
72private ExecutionContext? _context; 533_context = ExecutionContext.Capture(); 630ExecutionContext? context = _context; // store context before it's cleared as part of finishing the operation 640ExecutionContext.Run(context, s_executionCallback, this); 986ExecutionContext? context = _context; // store context before it's cleared as part of finishing the operation 997ExecutionContext.Run(context, s_executionCallback, this);
System.Private.CoreLib (147)
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)
652private ExecutionContext? _context; 686_context = ExecutionContext.Capture(); 708ExecutionContext? context = _context; 722ExecutionContext.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)
214using (ExecutionContext.SuppressFlow()) 239/// The <see cref="ExecutionContext"/> that was captured when each callback was registered 264/// The <see cref="ExecutionContext"/> that was captured when each callback was registered 296/// The <see cref="ExecutionContext"/> that was captured when each callback was registered 583Delegate callback, object? stateForCallback, SynchronizationContext? syncContext, ExecutionContext? executionContext) 1198public ExecutionContext? ExecutionContext; 1209ExecutionContext? context = ExecutionContext; 1217ExecutionContext.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)
224internal ExecutionContext? m_capturedContext; // The execution context to run the task within, if any. Only set from non-concurrent contexts. 523CapturedContext = ExecutionContext.Capture(); 1532internal ExecutionContext? CapturedContext 1542return m_contingentProperties?.m_capturedContext ?? ExecutionContext.Default; 1552else if (value != ExecutionContext.Default) // not the default context, then inflate the contingent properties and set it 2331ExecutionContext? ec = CapturedContext; 2342ExecutionContext.RunInternal(ec, s_ecCallback, this); 2346ExecutionContext.RunFromThreadPoolDispatchLoop(threadPoolThread, ec, s_ecCallback, this); 2887using (ExecutionContext.SuppressFlow()) 5768using (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)
31internal ExecutionContext? _executionContext; 51ExecutionContext.RunInternal(_executionContext, s_threadStartContextCallback, this); 215startHelper._executionContext = captureContext ? ExecutionContext.Capture() : null; 253startHelper._executionContext = captureContext ? ExecutionContext.Capture() : null; 376public 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 (18)
1029ExecutionContext.ResetThreadPoolThread(currentThread); 1311ExecutionContext.ResetThreadPoolThread(currentThread); 1353private readonly ExecutionContext _context; 1364internal QueueUserWorkItemCallback(WaitCallback callback, object? state, ExecutionContext context) 1377ExecutionContext.RunForThreadPoolUnsafe(_context, s_executionContextShim, this); 1385private readonly ExecutionContext _context; 1387internal QueueUserWorkItemCallback(Action<TState> callback, TState state, ExecutionContext context) 1404ExecutionContext.RunForThreadPoolUnsafe(_context, callback, in _state); 1423ExecutionContext.CheckThreadPoolAndContextsAreDefault(); 1451ExecutionContext.CheckThreadPoolAndContextsAreDefault(); 1467private readonly ExecutionContext? _executionContext; 1480_executionContext = ExecutionContext.Capture(); 1501ExecutionContext? context = helper._executionContext; 1509ExecutionContext.Run(context, timedOut ? _ccbt : _ccbf, helper); 1679ExecutionContext? context = ExecutionContext.Capture(); 1697ExecutionContext? context = ExecutionContext.Capture();
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (5)
475private readonly ExecutionContext? _executionContext; 509_executionContext = ExecutionContext.Capture(); 717ExecutionContext? context = _executionContext; 726ExecutionContext.RunFromThreadPoolDispatchLoop(Thread.CurrentThread, context, s_callCallbackInContext, this); 730ExecutionContext.RunInternal(context, s_callCallbackInContext, this);
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (2)
123data._executionContext = flowExecutionContext ? ExecutionContext.Capture() : null; 214ExecutionContext.Run(data._executionContext, callback, args);
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.OverlappedData.cs (1)
16internal ExecutionContext? _executionContext;
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)
175if (!ExecutionContext.IsFlowSuppressed()) 177ExecutionContext.SuppressFlow(); 187ExecutionContext.RestoreFlow();
System.ServiceModel.NetTcp (11)
System\ServiceModel\Channels\SocketConnection.cs (11)
202if (!ExecutionContext.IsFlowSuppressed()) 204ExecutionContext.SuppressFlow(); 212ExecutionContext.RestoreFlow(); 239ExecutionContext.RestoreFlow(); 285if (!ExecutionContext.IsFlowSuppressed()) 287ExecutionContext.SuppressFlow(); 297ExecutionContext.RestoreFlow(); 326ExecutionContext.RestoreFlow(); 768if (!ExecutionContext.IsFlowSuppressed()) 770ExecutionContext.SuppressFlow(); 781ExecutionContext.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\net9.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)
546/// <summary>The <see cref="ExecutionContext"/> present at the time of the ForEachAsync invocation. This is only used if on the default scheduler.</summary> 547private readonly ExecutionContext? _executionContext; 573_executionContext = ExecutionContext.Capture(); 692/// <summary>Executes the task body using the <see cref="ExecutionContext"/> captured when ForEachAsync was invoked.</summary> 703ExecutionContext.Run(_executionContext, static o => ((ForEachAsyncState<TSource>)o!)._taskBody(o), this);