412 references to CurrentThread
ComSvcConfig (3)
Tool.cs (3)
902Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); 905Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage)) 907Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
mscorlib (137)
system\applicationactivator.cs (3)
96if (Thread.CurrentThread.GetApartmentState() != ApartmentState.Unknown && Thread.CurrentThread.GetApartmentState() != m_apt) 98Thread.CurrentThread.SetApartmentState(m_apt);
system\convert.cs (2)
203return ChangeType(value, typeCode, Thread.CurrentThread.CurrentCulture); 322return ChangeType(value, conversionType, Thread.CurrentThread.CurrentCulture);
system\environment.cs (1)
1806return Thread.CurrentThread.ManagedThreadId;
system\globalization\culturedata.cs (3)
1214if (CultureInfo.UserDefaultUICulture.Name.Equals(Thread.CurrentThread.CurrentUICulture.Name)) 1401if (CultureInfo.UserDefaultUICulture.Name.Equals(Thread.CurrentThread.CurrentUICulture.Name)) 1524if (CultureInfo.UserDefaultUICulture.Name.Equals(Thread.CurrentThread.CurrentUICulture.Name))
system\globalization\cultureinfo.cs (4)
718return Thread.CurrentThread.CurrentCulture; 756Thread.CurrentThread.CurrentCulture = value; 816return Thread.CurrentThread.CurrentUICulture; 854Thread.CurrentThread.CurrentUICulture = value;
system\globalization\datetimeformatinfo.cs (1)
519System.Globalization.CultureInfo culture = System.Threading.Thread.CurrentThread.CurrentCulture;
system\globalization\datetimeparse.cs (1)
4383m_info = Thread.CurrentThread.CurrentCulture.CompareInfo;
system\globalization\numberformatinfo.cs (1)
467System.Globalization.CultureInfo culture = System.Threading.Thread.CurrentThread.CurrentCulture;
system\io\filesystemenumerable.cs (2)
93threadId = Thread.CurrentThread.ManagedThreadId; 117if (threadId == Thread.CurrentThread.ManagedThreadId && state == 0)
system\io\textwriter.cs (1)
119return Thread.CurrentThread.CurrentCulture;
system\resources\resourcemanager.cs (2)
1291culture = Thread.CurrentThread.GetCurrentUICultureNoAppX(); 1387culture = Thread.CurrentThread.GetCurrentUICultureNoAppX();
system\runtime\remoting\activationservices.cs (1)
704replyMsg = Thread.CurrentThread.InternalCrossContextCallback(
system\runtime\remoting\callcontext.cs (12)
44ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 56ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 67return Thread.CurrentThread.GetExecutionContextReader().LogicalCallContext.GetData(name); 75return Thread.CurrentThread.GetExecutionContextReader().IllogicalCallContext.GetData(name); 83return Thread.CurrentThread.GetExecutionContextReader().LogicalCallContext.Principal; 89Thread.CurrentThread. 99ExecutionContext.Reader ec = Thread.CurrentThread.GetExecutionContextReader(); 109ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 149ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 157ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 167LogicalCallContext lcc = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext; 174LogicalCallContext lcc = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext;
system\runtime\remoting\channelsinkstacks.cs (1)
448returnValue, outArgs, _msg.ArgCount, Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext, _msg);
system\runtime\remoting\crossappdomainchannel.cs (3)
377LogicalCallContext lcc = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext; 460retBuff = (byte[]) Thread.CurrentThread.InternalCrossContextCallback(null, 646_callCtx = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext;
system\runtime\remoting\crosscontextchannel.cs (6)
152replyMsg = (IMessage) Thread.CurrentThread.InternalCrossContextCallback(srvID.ServerContext, s_xctxDel, args); 275msgCtrl = (IMessageCtrl) Thread.CurrentThread.InternalCrossContextCallback(srvCtx, xctxDel, args); 377msgCtrl = (IMessageCtrl) Thread.CurrentThread.InternalCrossContextCallback(srvCtx, xctxDel, args); 425_callCtx = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext; 476retMsg = (IMessage) Thread.CurrentThread.InternalCrossContextCallback(_oldCtx, xctxDel, args); 541Thread.CurrentThread.InternalCrossContextCallback(_srvID.ServerContext, xctxDel, args);
system\runtime\remoting\lease.cs (2)
357sponsorCallThread = Thread.CurrentThread.GetHashCode(); 470int thisThread = Thread.CurrentThread.GetHashCode();
system\runtime\remoting\message.cs (5)
854+ Thread.CurrentThread.GetHashCode() 858+ Thread.CurrentThread.GetHashCode() 877LogicalCallContext callCtx = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext; 2558_callContext = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext; 2575_callContext = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext;
system\runtime\remoting\realproxy.cs (3)
637Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext.Merge( 815Thread currentThread = Thread.CurrentThread; 829Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext.PropagateIncomingHeadersToCallContext(retMsg);
system\runtime\remoting\remotingproxy.cs (4)
189if (CtorThread == Thread.CurrentThread.GetHashCode()) 251Thread currentThread = Thread.CurrentThread; 471CtorThread = Thread.CurrentThread.GetHashCode(); 514Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext.Clone();
system\runtime\remoting\remotingservices.cs (1)
1865return (ObjRef) Thread.CurrentThread.InternalCrossContextCallback(null, defCtxID, appDomainId, xctxDel, null);
system\runtime\remoting\stackbuildersink.cs (4)
70LogicalCallContext lcc = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext; 124LogicalCallContext latestCallContext = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext; 153LogicalCallContext latestCallContext = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext; 249LogicalCallContext latestCallContext = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext;
system\runtime\remoting\synchronizeddispatch.cs (2)
712_callCtx = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext; 797Thread.CurrentThread.InternalCrossContextCallback(_ctx, _xctxDel, new Object[] { this } );
system\runtime\remoting\terminatorsinks.cs (3)
341replyMsg = (IMessage) Thread.CurrentThread.InternalCrossContextCallback(Context.DefaultContext, xctxDel, args); 449msgCtrl = (IMessageCtrl) Thread.CurrentThread.InternalCrossContextCallback(Context.DefaultContext, xctxDel, args); 521retMsg = (IMessage) Thread.CurrentThread.InternalCrossContextCallback(_cliCtx, xctxDel, args);
system\security\accesscontrol\privilege.cs (3)
50private readonly Thread currentThread = Thread.CurrentThread; 460if ( !this.currentThread.Equals( Thread.CurrentThread )) 591if ( !this.currentThread.Equals( Thread.CurrentThread ))
system\security\principal\windowsidentity.cs (2)
771return SecurityContext.GetCurrentWI(Thread.CurrentThread.GetExecutionContextReader()); 778Thread currentThread = Thread.CurrentThread;
system\security\securitycontext.cs (12)
117Contract.Assert(currEC == Thread.CurrentThread.GetMutableExecutionContext(), "SecurityContextSwitcher used from another thread"); 126Contract.Assert(Thread.CurrentThread.GetExecutionContextReader().SecurityContext.IsSame(prevSC)); 297ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 308SecurityContext sc = Thread.CurrentThread.GetMutableExecutionContext().SecurityContext; 329return Thread.CurrentThread.GetExecutionContextReader().SecurityContext.IsFlowSuppressed(flags); 356ExecutionContext.Reader ec = Thread.CurrentThread.GetExecutionContextReader(); 365if (GetCurrentWI(Thread.CurrentThread.GetExecutionContextReader()) != null) 373Contract.Assert(GetCurrentWI(Thread.CurrentThread.GetExecutionContextReader()) == null); 416rData.scsw = SetSecurityContext(rData.sc, Thread.CurrentThread.GetExecutionContextReader().SecurityContext, modifyCurrentExecutionContext: true); 466ExecutionContext currEC = Thread.CurrentThread.GetMutableExecutionContext(); 557SecurityContext sc = SecurityContext.Capture(Thread.CurrentThread.GetExecutionContextReader(), ref stackMark); 657Contract.Assert(currentEC.IsSame(Thread.CurrentThread.GetExecutionContextReader()));
system\threading\CancellationTokenRegistration.cs (1)
86tokenSource.ThreadIDExecutingCallbacks != Thread.CurrentThread.ManagedThreadId) //the executingThreadID is not this threadID.
system\threading\CancellationTokenSource.cs (4)
666int myIndex = Thread.CurrentThread.ManagedThreadId % s_nLists; 730ThreadIDExecutingCallbacks = Thread.CurrentThread.ManagedThreadId; 804ThreadIDExecutingCallbacks = Thread.CurrentThread.ManagedThreadId; 859callback.CancellationTokenSource.ThreadIDExecutingCallbacks = Thread.CurrentThread.ManagedThreadId;
system\threading\compressedstack.cs (4)
381return Thread.CurrentThread.SetAppDomainStack((cs == null ? null:cs.CompressedStackHandle)); 389Thread.CurrentThread.RestoreAppDomainStack(appDomainStack); //Restore the previous AD Stack 395return Thread.CurrentThread.GetExecutionContextReader().SecurityContext.CompressedStack; 402Thread currentThread = Thread.CurrentThread;
system\threading\executioncontext.cs (15)
335Contract.Assert(Thread.CurrentThread == this.thread); 401Thread currentThread = Thread.CurrentThread; 411Thread currentThread = Thread.CurrentThread; 429if (_thread != Thread.CurrentThread) 435if (Thread.CurrentThread.GetMutableExecutionContext() != _ec) 444if (!Thread.CurrentThread.GetExecutionContextReader().SecurityContext.IsSame(_sc)) 672return Thread.CurrentThread.GetExecutionContextReader().GetLocalValue(local); 678ExecutionContext current = Thread.CurrentThread.GetMutableExecutionContext(); 948Thread currentThread = Thread.CurrentThread; 991EstablishCopyOnWriteScope(Thread.CurrentThread, false, ref ecsw); 997Contract.Assert(currentThread == Thread.CurrentThread); 1035Thread currentThread = Thread.CurrentThread; 1182ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 1193return Thread.CurrentThread.GetExecutionContextReader().IsFlowSuppressed; 1236ExecutionContext.Reader ecCurrent = Thread.CurrentThread.GetExecutionContextReader();
system\threading\hostexecutioncontextmanager.cs (2)
209ExecutionContext currentExecutionContext = Thread.CurrentThread.GetMutableExecutionContext(); 250ExecutionContext executionContext = Thread.CurrentThread.GetMutableExecutionContext();
system\threading\SpinLock.cs (2)
520int m_newOwner = Thread.CurrentThread.ManagedThreadId; 709return ((m_owner & (~LOCK_ID_DISABLE_MASK)) == Thread.CurrentThread.ManagedThreadId);
system\threading\synchronizationcontext.cs (3)
242ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext(); 252return Thread.CurrentThread.GetExecutionContextReader().SynchronizationContext ?? GetThreadLocalContext(); 262return Thread.CurrentThread.GetExecutionContextReader().SynchronizationContextNoFlow ?? GetThreadLocalContext();
system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (8)
357Contract.Assert(!m_threadProcessingMapping.ContainsKey(Thread.CurrentThread.ManagedThreadId), 359m_threadProcessingMapping[Thread.CurrentThread.ManagedThreadId] = ProcessingMode.ProcessingExclusiveTask; 377m_threadProcessingMapping.TryRemove(Thread.CurrentThread.ManagedThreadId, out currentMode); 406Contract.Assert(!m_threadProcessingMapping.ContainsKey(Thread.CurrentThread.ManagedThreadId), 408m_threadProcessingMapping[Thread.CurrentThread.ManagedThreadId] = ProcessingMode.ProcessingConcurrentTasks; 437m_threadProcessingMapping.TryRemove(Thread.CurrentThread.ManagedThreadId, out currentMode); 581if (isDefaultScheduler && taskWasPreviouslyQueued && !Thread.CurrentThread.IsThreadPoolThread) 591if (m_pair.m_threadProcessingMapping.TryGetValue(Thread.CurrentThread.ManagedThreadId, out currentThreadMode) &&
system\threading\Tasks\Task.cs (1)
3609(Thread.CurrentThread.ThreadState == ThreadState.AbortRequested) ||
system\threading\Tasks\TaskContinuation.cs (1)
519(TaskScheduler.InternalCurrent == m_scheduler || Thread.CurrentThread.IsThreadPoolThread);
system\threading\thread.cs (9)
202Thread.CurrentThread.m_CurrentCulture = args.CurrentValue; 211Thread.CurrentThread.m_CurrentUICulture = args.CurrentValue; 389if (this == Thread.CurrentThread) 402Contract.Assert(Thread.CurrentThread == this); 563Thread thread = Thread.CurrentThread; 1375return CurrentThread.GetCurrentContextInternal(); 1398lock (CurrentThread) 1479Contract.Assert(CurrentThread.m_Context == null || CurrentThread.m_Context.AppDomain == ad, "AppDomains on the managed & unmanaged threads should match");
system\threading\threadabortexception.cs (1)
52get {return Thread.CurrentThread.AbortReason;}
system\threading\threadpool.cs (1)
876public readonly Random random = new Random(Thread.CurrentThread.ManagedThreadId);
PresentationCore (17)
Core\CSharp\System\Windows\Input\InputManager.cs (1)
181if(Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
Core\CSharp\System\Windows\Input\InputMethod.cs (1)
474Dispatcher dispatcher = Dispatcher.FromThread(Thread.CurrentThread);
Core\CSharp\System\Windows\Input\InputProcessorProfiles.cs (1)
78Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Initialize called on MTA thread!");
Core\CSharp\System\Windows\Input\InputProcessorProfilesLoader.cs (1)
74Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Load called on MTA thread!");
Core\CSharp\System\Windows\Input\TextServicesContext.cs (1)
63Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "SetDispatcherThreaad on MTA thread");
Core\CSharp\System\Windows\Media\Effects\BitmapEffect.cs (1)
65if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
Core\CSharp\System\Windows\Media\HostVisual.cs (2)
148Debug.Assert(target.Dispatcher.Thread == Thread.CurrentThread); 201Debug.Assert(_target.Dispatcher.Thread == Thread.CurrentThread);
Core\CSharp\System\Windows\OleServicesContext.cs (9)
122if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 141if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 160if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 181if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 200if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 234if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 251if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 277if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 307if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
PresentationFramework (29)
src\Framework\Microsoft\Win32\CommonDialog.cs (2)
297if (_thread != Thread.CurrentThread) 424private Thread _thread = Thread.CurrentThread;
src\Framework\MS\Internal\Data\ClrBindingWorker.cs (2)
407if (Dispatcher.Thread == Thread.CurrentThread) 435if (Dispatcher.Thread == Thread.CurrentThread)
src\Framework\System\Windows\Controls\CalendarBlackoutDatesCollection.cs (2)
34this._dispatcherThread = Thread.CurrentThread; 345return Thread.CurrentThread == this._dispatcherThread;
src\Framework\System\Windows\Controls\SelectedDatesCollection.cs (2)
39this._dispatcherThread = Thread.CurrentThread; 475return Thread.CurrentThread == this._dispatcherThread;
src\Framework\System\Windows\Controls\SpellCheck.cs (1)
156new FrameworkPropertyMetadata(Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "de" ? SpellingReform.Postreform : SpellingReform.PreAndPostreform,
src\Framework\System\Windows\Controls\WebBrowser.cs (2)
452HRESULT hr = scriptObjectEx.GetIDsOfNames(ref guid, names, 1, Thread.CurrentThread.CurrentCulture.LCID, dispids); 481Thread.CurrentThread.CurrentCulture.LCID,
src\Framework\System\Windows\Data\BindingExpression.cs (1)
2520if (Dispatcher.Thread == Thread.CurrentThread)
src\Framework\System\Windows\Data\BindingExpressionBase.cs (1)
447if (Dispatcher.Thread == Thread.CurrentThread)
src\Framework\System\Windows\Data\BindingGroup.cs (1)
1528if (Dispatcher.Thread == Thread.CurrentThread)
src\Framework\System\Windows\Documents\Speller.cs (1)
56Thread.CurrentThread.CurrentCulture;
src\Framework\System\Windows\Documents\TextServicesHost.cs (3)
81Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "OnRegisterTextStore must be called on STA thread"); 86_thread = Thread.CurrentThread; 461if (_thread == Thread.CurrentThread || System.Environment.OSVersion.Version.Major >= 6)
src\Framework\System\Windows\Documents\TextStore.cs (1)
2300Invariant.Assert(Thread.CurrentThread == _textservicesHost.Dispatcher.Thread, "GrantLock called on bad thread!");
src\Framework\System\Windows\Documents\WinRTSpellerInterop.cs (1)
85_defaultCulture = InputLanguageManager.Current?.CurrentInputLanguage ?? Thread.CurrentThread.CurrentCulture;
src\Framework\System\Windows\Interop\ActiveXHost.cs (1)
113if (Thread.CurrentThread.ApartmentState != ApartmentState.STA)
src\Framework\System\Windows\Interop\DocobjHost.cs (2)
79_mainThread = Thread.CurrentThread; 1219if (Thread.CurrentThread == _mainThread)
src\Framework\System\Windows\Interop\DynamicScriptObject.cs (3)
615HRESULT hr = _scriptObject.GetIDsOfNames(ref guid, names, dispids.Length, Thread.CurrentThread.CurrentCulture.LCID, dispids); 667return _scriptObjectEx.InvokeEx(dispid, Thread.CurrentThread.CurrentCulture.LCID, flags, dp, out result, exInfo, BrowserInteropHelper.HostHtmlDocumentServiceProvider); 672return _scriptObject.Invoke(dispid, ref guid, Thread.CurrentThread.CurrentCulture.LCID, flags, dp, out result, exInfo, null);
src\Framework\System\Windows\Standard\Debug.cs (1)
340if (Thread.CurrentThread.GetApartmentState() != expectedState)
src\Framework\System\Windows\Standard\Verify.cs (1)
41if (Thread.CurrentThread.GetApartmentState() != requiredState)
src\Framework\System\Windows\SystemResources.cs (1)
1396Dispatcher dispatcher = isSysColorsOrSettingsChange ? null : Dispatcher.FromThread(System.Threading.Thread.CurrentThread);
System (35)
compmod\microsoft\win32\SystemEvents.cs (2)
489throw new ArgumentException(SR.GetString(SR.InvalidLowBoundArgument, "interval", interval.ToString(System.Threading.Thread.CurrentThread.CurrentCulture), "0")); 572if (!UserInteractive || Thread.CurrentThread.GetApartmentState() == ApartmentState.STA) {
compmod\system\componentmodel\CultureInfoConverter.cs (6)
93CultureInfo currentUICulture = Thread.CurrentThread.CurrentUICulture; 96Thread.CurrentThread.CurrentUICulture = culture; 145Thread.CurrentThread.CurrentUICulture = currentUICulture; 174CultureInfo currentUICulture = Thread.CurrentThread.CurrentUICulture; 177Thread.CurrentThread.CurrentUICulture = culture; 189Thread.CurrentThread.CurrentUICulture = currentUICulture;
compmod\system\diagnostics\TraceEventCache.cs (1)
106return Thread.CurrentThread.ManagedThreadId;
net\System\Net\_Connection.cs (3)
1530else if (Thread.CurrentThread.IsThreadPoolThread) 1595else if (Thread.CurrentThread.IsThreadPoolThread) 3574if (Thread.CurrentThread.IsThreadPoolThread)
net\System\Net\_TimerThread.cs (10)
306GlobalLog.Assert(m_Timers.Prev.Next == m_Timers, "TimerThread#{0}::CreateTimer()|m_Tail corruption.", Thread.CurrentThread.ManagedThreadId.ToString()); 530GlobalLog.Assert(m_TimerState != TimerState.Sentinel, "TimerThread#{0}::Fire()|TimerQueue tried to Fire a Sentinel.", Thread.CurrentThread.ManagedThreadId.ToString()); 638GlobalLog.Print("TimerThread#" + Thread.CurrentThread.ManagedThreadId.ToString() + "::ThreadProc() Start"); 643Thread.CurrentThread.IsBackground = true; 703GlobalLog.Print("TimerThread#" + Thread.CurrentThread.ManagedThreadId.ToString() + "::ThreadProc() Waiting for " + waitDuration + "ms"); 708GlobalLog.Print("TimerThread#" + Thread.CurrentThread.ManagedThreadId.ToString() + "::ThreadProc() Awoke, cause: Shutdown"); 713GlobalLog.Print("TimerThread#" + Thread.CurrentThread.ManagedThreadId.ToString() + "::ThreadProc() Awoke, cause: " + (waitResult == WaitHandle.WaitTimeout ? "Timeout" : "Prod")); 734if (Logging.On) Logging.PrintError(Logging.Web, "TimerThread#" + Thread.CurrentThread.ManagedThreadId.ToString(NumberFormatInfo.InvariantInfo) + "::ThreadProc() - Exception:" + exception.ToString()); 735GlobalLog.Print("TimerThread#" + Thread.CurrentThread.ManagedThreadId.ToString() + "::ThreadProc() exception: " + exception); 751GlobalLog.Print("TimerThread#" + Thread.CurrentThread.ManagedThreadId.ToString() + "::ThreadProc() Stop");
net\System\Net\Logging.cs (1)
293threadId = (uint)Thread.CurrentThread.GetHashCode();
net\System\Net\Sockets\Socket.cs (2)
2958(Thread.CurrentThread.IsThreadPoolThread || SettingsSectionInternal.Section.AlwaysUseCompletionPortsForConnect || m_IsDisconnected); 5333(Thread.CurrentThread.IsThreadPoolThread || SettingsSectionInternal.Section.AlwaysUseCompletionPortsForAccept || m_IsDisconnected);
services\monitoring\system\diagnosticts\Process.cs (1)
2855if( Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) {
sys\system\collections\concurrent\BlockingCollection.cs (1)
1765return Thread.CurrentThread.GetApartmentState() == ApartmentState.STA;
sys\system\collections\concurrent\ConcurrentBag.cs (3)
309list = new ThreadLocalList(Thread.CurrentThread); 319list = new ThreadLocalList(Thread.CurrentThread); 352currentList.m_ownerThread = Thread.CurrentThread; // the caller should acquire a lock to make this line thread safe
sys\system\threading\Barrier.cs (5)
352if (m_actionCallerID != 0 && Thread.CurrentThread.ManagedThreadId == m_actionCallerID) 453if (m_actionCallerID != 0 && Thread.CurrentThread.ManagedThreadId == m_actionCallerID) 648if (m_actionCallerID != 0 && Thread.CurrentThread.ManagedThreadId == m_actionCallerID) 790m_actionCallerID = Thread.CurrentThread.ManagedThreadId; 936if (m_actionCallerID != 0 && Thread.CurrentThread.ManagedThreadId == m_actionCallerID)
System.Activities (7)
System\Activities\WorkflowApplication.cs (7)
314return this.isInHandler && this.handlerThreadId == Thread.CurrentThread.ManagedThreadId; 985this.handlerThreadId = Thread.CurrentThread.ManagedThreadId; 2721this.handlerThreadId = Thread.CurrentThread.ManagedThreadId; 2772this.handlerThreadId = Thread.CurrentThread.ManagedThreadId; 4999application.handlerThreadId = Thread.CurrentThread.ManagedThreadId; 5132instance.handlerThreadId = Thread.CurrentThread.ManagedThreadId; 5267instance.handlerThreadId = Thread.CurrentThread.ManagedThreadId;
System.Core (6)
System\Diagnostics\Eventing\Reader\EventLogWatcher.cs (2)
116if (this.callbackThreadId != Thread.CurrentThread.ManagedThreadId) { 202this.callbackThreadId = Thread.CurrentThread.ManagedThreadId;
System\Linq\Enumerable.cs (2)
76threadId = Thread.CurrentThread.ManagedThreadId; 91if (threadId == Thread.CurrentThread.ManagedThreadId && state == 0) {
System\Linq\Parallel\Channels\AsynchronousChannel.cs (2)
208Thread.CurrentThread.ManagedThreadId); 222Thread.CurrentThread.ManagedThreadId);
System.Data (8)
fx\src\data\System\Data\OleDb\OleDbConnectionInternal.cs (2)
687if (ApartmentState.Unknown == Thread.CurrentThread.GetApartmentState()) { 697Thread.CurrentThread.SetApartmentState(ApartmentState.MTA);
fx\src\data\System\Data\ProviderBase\DbConnectionPool.cs (1)
1070Debug.Assert(!Thread.CurrentThread.IsThreadPoolThread, "This thread may block for a long time. Threadpool threads should not be used.");
fx\src\data\System\Data\SqlClient\SqlInternalConnectionTds.cs (4)
2662return _threadIdOwningParserLock == Thread.CurrentThread.ManagedThreadId; 2666Debug.Assert(_threadIdOwningParserLock == -1 || _threadIdOwningParserLock == Thread.CurrentThread.ManagedThreadId, "Another thread already claims to own the parser lock"); 2670_threadIdOwningParserLock = Thread.CurrentThread.ManagedThreadId; 2672else if (_threadIdOwningParserLock == Thread.CurrentThread.ManagedThreadId) {
fx\src\data\System\Data\SQLTypes\SQLDateTime.cs (1)
356DateTimeFormatInfo dtfi = (DateTimeFormatInfo)(Thread.CurrentThread.CurrentCulture.GetFormat(typeof(DateTimeFormatInfo)));
System.IO.Log (2)
System\IO\Log\FileRecordSequence.cs (2)
479if (this.tailPinnedThreadID == Thread.CurrentThread.ManagedThreadId) 499this.tailPinnedThreadID = Thread.CurrentThread.ManagedThreadId;
System.Management (1)
InteropClasses\WMIInterop.cs (1)
2100if(Thread.CurrentThread.GetApartmentState() != ApartmentState.MTA)
System.ServiceModel (20)
System\ServiceModel\Administration\WbemProvider.cs (1)
1059if (Thread.CurrentThread.GetApartmentState() != ApartmentState.MTA)
System\ServiceModel\Channels\Msmq4PoisonHandler.cs (1)
68if (Thread.CurrentThread.IsThreadPoolThread)
System\ServiceModel\Channels\PipeConnection.cs (1)
2225if (!Thread.CurrentThread.IsThreadPoolThread)
System\ServiceModel\Channels\ReliableChannelListener.cs (1)
773if (Thread.CurrentThread.IsThreadPoolThread)
System\ServiceModel\Channels\ReliableDuplexSessionChannel.cs (1)
1588if (Thread.CurrentThread.IsThreadPoolThread)
System\ServiceModel\Channels\ReliableMessagingHelpers.cs (1)
965else if (Thread.CurrentThread.IsThreadPoolThread)
System\ServiceModel\Channels\ReliableOutputSessionChannel.cs (1)
1015if (Thread.CurrentThread.IsThreadPoolThread)
System\ServiceModel\Channels\SharedHttpTransportManager.cs (1)
573if (Thread.CurrentThread.IsThreadPoolThread)
System\ServiceModel\Channels\SocketConnection.cs (2)
1809if (Thread.CurrentThread.IsThreadPoolThread) 2188if (!Thread.CurrentThread.IsThreadPoolThread)
System\ServiceModel\ComIntegration\ComPlusDiagnosticTraceRecords.cs (5)
199System.Threading.Thread.CurrentThread.ManagedThreadId, SafeNativeMethods.GetCurrentThreadId()); 233instanceID, System.Threading.Thread.CurrentThread.ManagedThreadId, SafeNativeMethods.GetCurrentThreadId(), callerIdentity, guidContextTrsansactionID); 239instanceID, System.Threading.Thread.CurrentThread.ManagedThreadId, SafeNativeMethods.GetCurrentThreadId(), callerIdentity); 251instanceID, System.Threading.Thread.CurrentThread.ManagedThreadId, SafeNativeMethods.GetCurrentThreadId(), callerIdentity, 262instanceID, System.Threading.Thread.CurrentThread.ManagedThreadId, SafeNativeMethods.GetCurrentThreadId(), callerIdentity,
System\ServiceModel\ComIntegration\ComPlusThreadInitializer.cs (2)
180System.Threading.Thread.CurrentThread.ManagedThreadId.ToString(CultureInfo.InvariantCulture), 240System.Threading.Thread.CurrentThread.ManagedThreadId.ToString(CultureInfo.InvariantCulture),
System\ServiceModel\Dispatcher\ChannelHandler.cs (1)
621if (Thread.CurrentThread.IsThreadPoolThread)
System\ServiceModel\OperationContextScope.cs (2)
22readonly Thread thread = Thread.CurrentThread; 80if (ServiceModelAppSettings.DisableOperationContextAsyncFlow && this.thread != Thread.CurrentThread)
System.ServiceModel.Activation (1)
System\ServiceModel\Activation\HostedHttpTransportManager.cs (1)
253Thread currentThread = Thread.CurrentThread;
System.ServiceModel.Activities (7)
System\ServiceModel\Activities\Dispatcher\WorkflowServiceInstance.cs (7)
279return this.isInHandler && this.handlerThreadId == Thread.CurrentThread.ManagedThreadId; 1245this.handlerThreadId = Thread.CurrentThread.ManagedThreadId; 1299this.handlerThreadId = Thread.CurrentThread.ManagedThreadId; 1345thisPtr.handlerThreadId = Thread.CurrentThread.ManagedThreadId; 1377thisPtr.handlerThreadId = Thread.CurrentThread.ManagedThreadId; 1419this.handlerThreadId = Thread.CurrentThread.ManagedThreadId; 1456thisPtr.handlerThreadId = Thread.CurrentThread.ManagedThreadId;
System.ServiceModel.Channels (4)
System\ServiceModel\Channels\UdpSocketReceiveManager.cs (4)
114if (Thread.CurrentThread.IsThreadPoolThread) 180Fx.Assert(Thread.CurrentThread.IsThreadPoolThread, "Receive loop is running on a non-threadpool thread. If this thread disappears while a completion port operation is outstanding, then the operation will get canceled."); 306if (StartAsyncReceive(socket) && !Thread.CurrentThread.IsThreadPoolThread) 316jumpThreads = !Thread.CurrentThread.IsThreadPoolThread;
System.ServiceModel.Internals (2)
System\Runtime\SynchronizedPool.cs (2)
213int thisThreadID = Thread.CurrentThread.ManagedThreadId; 266int thisThreadID = Thread.CurrentThread.ManagedThreadId;
System.Transactions (6)
System\Transactions\Oletx\OletxResourceManager.cs (1)
692resourceManager.reenlistThread = Thread.CurrentThread;
System\Transactions\TransactionScope.cs (5)
608if ((this.scopeThread != Thread.CurrentThread) && !this.AsyncFlowEnabled) 1037this.scopeThread = Thread.CurrentThread; 1104if (this.scopeThread == Thread.CurrentThread) 1120if (this.savedCurrentScope.scopeThread != Thread.CurrentThread) 1141if (this.scopeThread != Thread.CurrentThread)
System.Web (74)
Hosting\AsyncResultBase.cs (3)
38if (Volatile.Read(ref _threadWhichStartedOperation) == Thread.CurrentThread) { 65Thread originalThread = Interlocked.CompareExchange(ref _threadWhichStartedOperation, Thread.CurrentThread, null); 71Debug.Assert(originalThread == Thread.CurrentThread, "This thread did not call MarkCallToBeginMethodStarted.");
Hosting\HostingEnvironment.cs (8)
1818CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; 1819CultureInfo currentUICulture = Thread.CurrentThread.CurrentUICulture; 1822Thread.CurrentThread.CurrentCulture = culture; 1827Thread.CurrentThread.CurrentUICulture = uiCulture; 1833if (_savedCulture != null && _savedCulture != Thread.CurrentThread.CurrentCulture) { 1834Thread.CurrentThread.CurrentCulture = _savedCulture; 1838if (_savedUICulture != null && _savedUICulture != Thread.CurrentThread.CurrentUICulture) { 1839Thread.CurrentThread.CurrentUICulture = _savedUICulture;
Hosting\IPipelineRuntime.cs (2)
553&& context.ThreadInsideIndicateCompletion != Thread.CurrentThread 624context.ThreadInsideIndicateCompletion = Thread.CurrentThread;
HttpApplication.cs (12)
2048_savedAppLevelCulture = Thread.CurrentThread.CurrentCulture; 2049_savedAppLevelUICulture = Thread.CurrentThread.CurrentUICulture; 2051if (culture != null && culture != Thread.CurrentThread.CurrentCulture) { 2055if (uiculture != null && uiculture != Thread.CurrentThread.CurrentUICulture) { 2056Thread.CurrentThread.CurrentUICulture = uiculture; 2061CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; 2062CultureInfo currentUICulture = Thread.CurrentThread.CurrentUICulture; 2076Thread.CurrentThread.CurrentUICulture = _savedAppLevelUICulture; 2233((Thread.CurrentThread.ThreadState & ThreadState.AbortRequested) == 0)) { 2283if (Thread.CurrentThread.IsThreadPoolThread) { 4114if (context.InIndicateCompletion && context.ThreadInsideIndicateCompletion == Thread.CurrentThread) { 4281if (context.ThreadInsideIndicateCompletion == Thread.CurrentThread) {
HttpAsyncResult.cs (3)
69if (Volatile.Read(ref _threadWhichStartedOperation) == Thread.CurrentThread) { 111Thread originalThread = Interlocked.CompareExchange(ref _threadWhichStartedOperation, Thread.CurrentThread, null); 117Debug.Assert(originalThread == Thread.CurrentThread, "This thread did not call MarkCallToBeginMethodStarted.");
HttpContext.cs (2)
383_threadWhichStartedWebSocketTransition = Thread.CurrentThread; 389return _threadWhichStartedWebSocketTransition == Thread.CurrentThread;
HttpResponse.cs (4)
1187savedUiculture = Thread.CurrentThread.CurrentUICulture; 1188Thread.CurrentThread.CurrentUICulture = uiculture; 1233Thread.CurrentThread.CurrentUICulture = savedUiculture; 3115Thread.CurrentThread.Abort(new HttpApplication.CancelModuleException(false));
HttpRuntime.cs (5)
626CultureInfo savedCulture = Thread.CurrentThread.CurrentCulture; 627CultureInfo savedUICulture = Thread.CurrentThread.CurrentUICulture; 671Thread.CurrentThread.CurrentUICulture = savedUICulture; 706Thread.CurrentThread.CurrentCulture = cultureInfo; 1335Thread.CurrentThread.CurrentUICulture = HttpServerUtility.CreateReadOnlyCultureInfo(globConfig.UICulture);
Management\WebEvents.cs (1)
2144_threadId = Thread.CurrentThread.ManagedThreadId;
ModelBinding\DataAnnotationsModelValidator.cs (1)
39.GetLocalizedString(Thread.CurrentThread.CurrentUICulture, name, arguments);
State\SessionStateContainer.cs (2)
175get { return Thread.CurrentThread.CurrentCulture.LCID; } 176set { Thread.CurrentThread.CurrentCulture = HttpServerUtility.CreateReadOnlyCultureInfo(value); }
ThreadContext.cs (11)
101HttpContext.CurrentThread = Thread.CurrentThread; 253CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; 254CultureInfo currentUICulture = Thread.CurrentThread.CurrentUICulture; 272Thread.CurrentThread.CurrentUICulture = _originalThreadCurrentUICulture; 322_originalThreadCurrentCulture = Thread.CurrentThread.CurrentCulture; 323_originalThreadCurrentUICulture = Thread.CurrentThread.CurrentUICulture; 325if (culture != null && culture != Thread.CurrentThread.CurrentCulture) { 329if (uiculture != null && uiculture != Thread.CurrentThread.CurrentUICulture) { 330Thread.CurrentThread.CurrentUICulture = uiculture; 338HttpContext.DynamicCulture = Thread.CurrentThread.CurrentCulture; 339HttpContext.DynamicUICulture = Thread.CurrentThread.CurrentUICulture;
UI\BatchParser.cs (1)
47Thread currentThread = Thread.CurrentThread;
UI\LegacyPageAsyncTaskManager.cs (1)
333if (Thread.CurrentThread.IsThreadPoolThread) {
UI\Page.cs (8)
3873Thread.CurrentThread.CurrentCulture = newCulture; 3877get { return Thread.CurrentThread.CurrentCulture.DisplayName; } 3891Thread.CurrentThread.CurrentCulture = newCulture; 3895get { return Thread.CurrentThread.CurrentCulture.LCID; } 3943Thread.CurrentThread.CurrentUICulture = newUICulture; 3947get { return Thread.CurrentThread.CurrentUICulture.DisplayName; } 4409Thread currentThread = Thread.CurrentThread; 5964if (Thread.CurrentThread.IsThreadPoolThread) {
UI\TemplateParser.cs (1)
679Thread currentThread = Thread.CurrentThread;
Util\AppVerifier.cs (3)
275Thread threadWhichCalledBeginHandler = Thread.CurrentThread; // used to determine whether the callback was invoked synchronously 313assert(tempThreadWhichCalledBeginHandler != Thread.CurrentThread, AppVerifierErrorCode.AsyncCallbackInvokedSynchronouslyButAsyncResultWasNotMarkedCompletedSynchronously); 744ThreadId = Thread.CurrentThread.ManagedThreadId;
Util\ReadWriteSpinLock.cs (2)
95int threadId = Thread.CurrentThread.GetHashCode(); 109int threadId = Thread.CurrentThread.GetHashCode();
Util\SynchronizationHelper.cs (4)
76if (CurrentThread == Thread.CurrentThread) { 92CurrentThread = Thread.CurrentThread; 138if (CurrentThread == Thread.CurrentThread) { 154CurrentThread = Thread.CurrentThread;
System.Web.Extensions (3)
UI\ScriptResourceAttribute.cs (3)
175CultureInfo previousCulture = Thread.CurrentThread.CurrentUICulture; 178Thread.CurrentThread.CurrentUICulture = culture; 211Thread.CurrentThread.CurrentUICulture = previousCulture;
System.Web.Services (3)
System\Web\Services\Protocols\SoapHeader.cs (3)
209if (Thread.CurrentThread.GetHashCode() != this.currentThread) return; 217if (Thread.CurrentThread.GetHashCode() != this.currentThread) return; 239this.currentThread = Thread.CurrentThread.GetHashCode();
System.Windows.Forms (14)
winforms\Managed\System\WinForms\Application.cs (8)
322return Thread.CurrentThread.CurrentCulture; 325Thread.CurrentThread.CurrentCulture = value; 1374current.idleHandler(Thread.CurrentThread, e); 2743enterModalHandler(Thread.CurrentThread, EventArgs.Empty); 2954leaveModalHandler(Thread.CurrentThread, EventArgs.Empty); 3179Thread current = Thread.CurrentThread; 3240threadExceptionHandler(Thread.CurrentThread, new ThreadExceptionEventArgs(t)); 3930idleHandler(Thread.CurrentThread, EventArgs.Empty);
winforms\Managed\System\WinForms\AxHost.cs (4)
2444return Thread.CurrentThread.CurrentCulture.LCID; 3734threadId = Thread.CurrentThread.ManagedThreadId; 3823if (threadId == Thread.CurrentThread.ManagedThreadId) { 3942if (connectionPoint.threadId == Thread.CurrentThread.ManagedThreadId) {
winforms\Managed\System\WinForms\Control.Ime.cs (1)
1366Debug.WriteLineIf(CompModSwitches.ImeMode.Level >= TraceLevel.Info, "Inside get_InputLanguageTable(), Input Language = " + InputLanguage.CurrentInputLanguage.Culture.DisplayName + ", Thread = " + System.Threading.Thread.CurrentThread.ManagedThreadId);
winforms\Managed\System\WinForms\WindowsFormsSynchronizationContext.cs (1)
38DestinationThread = Thread.CurrentThread; //store the current thread to ensure its still alive during an invoke.
System.Workflow.Activities (1)
LocalService\ExternalDataExchangeService.cs (1)
92String.Format(Thread.CurrentThread.CurrentCulture, SR.GetString(SR.Error_UnknownConfigurationParameter), key), "parameters");
System.Workflow.ComponentModel (1)
AuthoringOM\Design\DesignerHelpers.cs (1)
1748string rulesText = (expression != null) ? expressionPropertyDescriptor.Converter.ConvertTo(new TypeDescriptorContext(activity.Site, null, value), System.Threading.Thread.CurrentThread.CurrentUICulture, expression, typeof(string)) as string : null;
System.Workflow.Runtime (9)
DebugEngine\BreakSafeBase.cs (1)
44return Thread.CurrentThread.ManagedThreadId == this.controllerManagedThreadId;
Hosting\DefaultWorkflowSchedulerService.cs (2)
69throw new ArgumentException(String.Format(Thread.CurrentThread.CurrentCulture, ExecutionStringManager.UnknownConfigurationParameter, "null")); 72throw new ArgumentException(String.Format(Thread.CurrentThread.CurrentCulture, ExecutionStringManager.UnknownConfigurationParameter, key));
Hosting\ManualWorkflowSchedulerService.cs (2)
87throw new ArgumentException(String.Format(Thread.CurrentThread.CurrentCulture, ExecutionStringManager.UnknownConfigurationParameter, "null")); 90throw new ArgumentException(String.Format(Thread.CurrentThread.CurrentCulture, ExecutionStringManager.UnknownConfigurationParameter, key));
Hosting\SqlWorkflowPersistenceService.cs (3)
470Exception e = new InvalidOperationException(string.Format(Thread.CurrentThread.CurrentCulture, ExecutionStringManager.InstanceNotFound, instanceStateId)); 527string.Format(Thread.CurrentThread.CurrentCulture, 792String.Format(Thread.CurrentThread.CurrentCulture, ExecutionStringManager.UnknownConfigurationParameter, key), "parameters");
WorkflowRuntime.cs (1)
607throw new InvalidOperationException(string.Format(Thread.CurrentThread.CurrentCulture, ExecutionStringManager.InstanceNotFound, instanceId));
System.Xml (3)
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (2)
30threadCode = Thread.CurrentThread.GetHashCode(); 44if (tempAssembly != null && Thread.CurrentThread.GetHashCode() == threadCode)
System\Xml\XPath\Internal\CompiledXPathExpr.cs (1)
134this.cinfo = System.Threading.Thread.CurrentThread.CurrentCulture;
WindowsBase (16)
Base\MS\Internal\Verify.cs (1)
35if (Thread.CurrentThread.GetApartmentState() != requiredState)
Base\System\Windows\Threading\Dispatcher.cs (5)
63Dispatcher currentDispatcher = FromThread(Thread.CurrentThread);; 211return Thread == Thread.CurrentThread; 417Dispatcher currentDispatcher = FromThread(Thread.CurrentThread);; 1919_dispatcherThread = Thread.CurrentThread; 2429if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA)
Base\System\Windows\Threading\DispatcherOperation.cs (1)
214if(_dispatcher.Thread == Thread.CurrentThread)
Shared\MS\Internal\ReaderWriterLockSlimWrapper.cs (1)
275Dispatcher.FromThread(Thread.CurrentThread)?.DisableProcessing();
Shared\MS\Internal\TextServicesLoader.cs (1)
111Invariant.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Load called on MTA thread!");
Shared\MS\Win32\HwndSubclass.cs (1)
373Dispatcher dispatcher = Dispatcher.FromThread(Thread.CurrentThread);
Shared\MS\Win32\HwndWrapper.cs (6)
69_ownerThreadID = new SecurityCriticalDataForSet<int>(Thread.CurrentThread.ManagedThreadId); 119if(null != Thread.CurrentThread.Name && 64 <= Thread.CurrentThread.Name.Length) 120threadName = Thread.CurrentThread.Name.Substring(0, 64); 122threadName = Thread.CurrentThread.Name; 245if(Thread.CurrentThread.ManagedThreadId == _ownerThreadID.Value)
WsatConfig (3)
CommandLine\ConsoleEntryPoint.cs (3)
256Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); 259(System.Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage)) 261Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");