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