82 instantiations of Thread
Aspire.Hosting.Testing (1)
DistributedApplicationEntryPointInvoker.cs (1)
78var thread = new Thread(() =>
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (1)
54this.drainThread = new Thread(this.DrainEntries)
csc (1)
src\Compilers\Shared\BuildClient.cs (1)
187var thread = new Thread(action);
GetDocument.Insider (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
225var thread = new Thread(() =>
HttpStress (1)
Program.cs (1)
539new Thread(() =>
IdeBenchmarks (1)
InheritanceMargin\InheritanceMarginGlyphBenchmarks.cs (1)
165var mainThread = new Thread(() =>
InteractiveHost32 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
40var uiThread = new Thread(() =>
InteractiveHost64 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
40var uiThread = new Thread(() =>
Microsoft.AspNetCore.Mvc.Testing (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
225var thread = new Thread(() =>
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Infrastructure\Heartbeat.cs (1)
30_timerThread = new Thread(state => ((Heartbeat)state!).TimerLoop())
Microsoft.AspNetCore.TestHost (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
225var thread = new Thread(() =>
Microsoft.Build (8)
AwaitExtensions.cs (1)
184Thread thread = new Thread(threadStart);
BackEnd\Client\MSBuildClientPacketPump.cs (1)
159_packetPumpThread = new Thread(PacketPumpProc)
BackEnd\Components\Communications\NodeEndpointInProc.cs (1)
356_packetPump = new Thread(PacketPumpProc);
BackEnd\Components\Communications\NodeProviderInProc.cs (1)
374_inProcNodeThread = new Thread(InProcNodeThreadProc, BuildParameters.ThreadStackSize);
BackEnd\Components\Logging\LoggingService.cs (1)
1403_loggingEventProcessingThread = new Thread(LoggingEventProc);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
1482var thread = new Thread(() =>
BackEnd\Components\RequestBuilder\TaskBuilder.cs (1)
580staThread = new Thread(taskRunnerDelegate);
NodeEndpointOutOfProcBase.cs (1)
332_packetPump = new Thread(PacketPumpProc);
Microsoft.Build.Engine.UnitTests (1)
BackEnd\BuildRequestEngine_Tests.cs (1)
90_builderThread = new Thread(BuilderThreadProc);
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
EndToEndTests.cs (1)
40var thread = new System.Threading.Thread(() =>
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\GetSemanticInfoTests.cs (1)
3282threads[i] = new Thread(ts);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Threading\StaTaskScheduler.cs (1)
67StaThread = new Thread(() =>
Microsoft.CodeAnalysis.InteractiveHost (2)
Interactive\Core\InteractiveHost.RemoteService.cs (2)
52_readOutputThread = new Thread(() => ReadOutput(error: false)); 57_readErrorOutputThread = new Thread(() => ReadOutput(error: true));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
TestExportJoinableTaskContext+DenyExecutionSynchronizationContext.cs (1)
60MainThread = mainThread ?? new Thread(MainThreadStart);
Microsoft.Extensions.Hosting.WindowsServices (1)
WindowsServiceLifetime.cs (1)
89Thread thread = new Thread(Run);
Microsoft.Extensions.Logging.Console (1)
ConsoleLoggerProcessor.cs (1)
71_outputThread = new Thread(ProcessLogQueue)
Microsoft.Extensions.ObjectPool.Tests (1)
ThreadingTest.cs (1)
36threads[i] = new Thread(Run);
Microsoft.Extensions.TimeProvider.Testing.Tests (1)
FakeTimeProviderTests.cs (1)
506var th = new Thread(() => provider.GetUtcNow());
Microsoft.ML.Core (2)
Utilities\ThreadUtils.cs (2)
22new Thread(start) { IsBackground = false }; 72var t = new Thread(() =>
Microsoft.ML.Core.Tests (1)
UnitTests\TestHosts.cs (1)
41var addThread = new Thread(
Microsoft.ML.TestFramework (1)
BaseTestBaseline.cs (1)
966var t = new Thread(() =>
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\Interaction.vb (1)
223Dim thread As New Thread(New ThreadStart(AddressOf inputHandler.StartHere))
Microsoft.VisualBasic.Tests (1)
Microsoft\VisualBasic\MyServices\Internal\ContextValueTests.cs (1)
37Thread thread = new(() =>
MSBuild (4)
NodeEndpointOutOfProcBase.cs (1)
332_packetPump = new Thread(PacketPumpProc);
OutOfProcTaskAppDomainWrapperBase.cs (1)
232Thread staThread = new Thread(taskRunnerDelegate);
OutOfProcTaskHostNode.cs (1)
726_taskRunnerThread = new Thread(new ParameterizedThreadStart(RunTask));
TerminalLogger\TerminalLogger.cs (1)
393_refresher = new Thread(ThreadProc);
MSBuildTaskHost (3)
NodeEndpointOutOfProcBase.cs (1)
332_packetPump = new Thread(PacketPumpProc);
OutOfProcTaskAppDomainWrapperBase.cs (1)
232Thread staThread = new Thread(taskRunnerDelegate);
OutOfProcTaskHostNode.cs (1)
726_taskRunnerThread = new Thread(new ParameterizedThreadStart(RunTask));
PresentationCore (3)
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (1)
294Thread inkingThread = new Thread(new ThreadStart(InkingThreadProc));
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (1)
482Thread thread = new Thread(new ThreadStart(ThreadProc))
System\Windows\Media\Imaging\BitmapDownload.cs (1)
60_thread = new Thread(new ThreadStart(DownloadThreadProc));
PresentationCore.Tests (1)
BinaryFormat\DataObjectTests.cs (1)
14Thread testThread = new Thread(() => TestLogic(value));
PresentationUI (1)
MS\Internal\Documents\SigningProgress.cs (1)
52Thread dialogThread = new Thread(
ScenarioTests.Common.Tests (2)
ThreadHoppingSynchronizationContext.cs (2)
15var t = new Thread(CallbackRunner); 21var t = new Thread(CallbackRunner);
System.Data.Odbc (2)
Common\System\Data\ProviderBase\DbConnectionPool.cs (2)
707Thread waitOpenThread = new Thread(WaitForPendingOpen); 934Thread waitOpenThread = new Thread(WaitForPendingOpen);
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Metrics\AggregationManager.cs (1)
167_collectThread = new Thread(() => CollectWorker(_cts.Token));
System.IO.FileSystem.Watcher (1)
System\IO\FileSystemWatcher.Linux.cs (1)
301new Thread(obj => ((RunningInstance)obj!).ProcessEvents())
System.Net.Requests (1)
System\Net\TimerThread.cs (1)
471new Thread(new ThreadStart(ThreadProc))
System.Net.Sockets (1)
System\Net\Sockets\SocketAsyncEngine.Unix.cs (1)
203var thread = new Thread(static s => ((SocketAsyncEngine)s!).EventLoop())
System.Private.CoreLib (7)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (1)
167s_pollingThread = new Thread(PollForValues)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (1)
107new Thread(HandleSignal)
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.GateThread.cs (1)
238Thread gateThread = new Thread(GateThreadStart, SmallStackSizeBytes)
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (1)
186Thread waitThread = new Thread(WaitThreadStart, SmallStackSizeBytes)
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerThread.cs (1)
76Thread workerThread = new Thread(s_workerThreadStart);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (1)
48new Thread(s_longRunningThreadWork)
src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (1)
38Thread timerThread = new Thread(TimerThread)
System.Windows.Forms (1)
System\Windows\Forms\Printing\PrintControllerWithStatusDialog.BackgroundThread.cs (1)
24_thread = new Thread(new ThreadStart(Run));
System.Windows.Forms.Tests (3)
System\Windows\Forms\ControlTests.ControlCollection.cs (2)
1124Thread thread = new(() => 1148Thread thread = new(() =>
System\Windows\Forms\WindowsFormsSynchronizationContextTests.cs (1)
81Thread thread = new(() =>
System.Windows.Forms.UI.IntegrationTests (1)
Infra\DenyExecutionSynchronizationContext.cs (1)
23_mainThread = mainThread ?? new Thread(MainThreadStart);
System.Xaml (1)
System\Xaml\XamlBackgroundReader.cs (1)
94_thread = new Thread(start)
UIAutomationClient (1)
MS\Internal\Automation\QueueProcessor.cs (1)
67_thread = new Thread(threadStart)
UIAutomationClientSideProviders (1)
MS\Internal\AutomationProxies\QueueProcessor.cs (1)
59Thread thread = new Thread(threadStart)
vbc (1)
src\Compilers\Shared\BuildClient.cs (1)
187var thread = new Thread(action);
VBCSCompiler (1)
src\Compilers\Shared\BuildClient.cs (1)
187var thread = new Thread(action);
WindowsBase.Tests (9)
Helpers.cs (2)
19var t = new Thread(() => 44var t = new Thread(() =>
System\Windows\Data\DataSourceProviderTests.cs (2)
1380var thread = new Thread(() => 1828var thread = new Thread(() =>
System\Windows\Threading\DispatcherObjectTests.cs (2)
31var thread = new Thread(() => 72var thread = new Thread(() =>
System\Windows\Threading\DispatcherTests.cs (3)
46var thread = new Thread(() => { }); 162var thread = new Thread(() => 183var thread = new Thread(() =>
953 references to Thread
Aspire.Dashboard.Components.Tests (9)
UseCultureAttribute.cs (9)
12/// <see cref="Thread.CurrentThread" /> <see cref="CultureInfo.CurrentCulture" /> and 61/// Stores the current <see cref="Thread.CurrentPrincipal" /> 68_originalCulture = Thread.CurrentThread.CurrentCulture; 69_originalUICulture = Thread.CurrentThread.CurrentUICulture; 71Thread.CurrentThread.CurrentCulture = Culture; 72Thread.CurrentThread.CurrentUICulture = UICulture; 80/// <see cref="CultureInfo.CurrentUICulture" /> to <see cref="Thread.CurrentPrincipal" /> 85Thread.CurrentThread.CurrentCulture = _originalCulture!; 86Thread.CurrentThread.CurrentUICulture = _originalUICulture!;
Aspire.Hosting.Testing (1)
DistributedApplicationEntryPointInvoker.cs (1)
78var thread = new Thread(() =>
Aspire.Hosting.Tests (1)
Utils\DockerUtils.cs (1)
16Thread.Sleep(1000);
Aspire.Microsoft.Data.SqlClient (3)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\ExceptionExtensions.cs (3)
20var originalUICulture = Thread.CurrentThread.CurrentUICulture; 24Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 29Thread.CurrentThread.CurrentUICulture = originalUICulture;
Aspire.Microsoft.EntityFrameworkCore.SqlServer (3)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\ExceptionExtensions.cs (3)
20var originalUICulture = Thread.CurrentThread.CurrentUICulture; 24Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 29Thread.CurrentThread.CurrentUICulture = originalUICulture;
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (1)
35private readonly Thread drainThread;
BasicWebSite (1)
Controllers\AsyncActionsController.cs (1)
204Thread.Sleep(simulateDelayMilliseconds);
Binding.Http.IntegrationTests (2)
OperationContextTests.cs (2)
48int currentThreadId = Thread.CurrentThread.ManagedThreadId; 50Assert.NotEqual(currentThreadId, Thread.CurrentThread.ManagedThreadId);
Binding.Tcp.IntegrationTests (9)
NetTcpBindingTests.4.0.0.cs (1)
144Thread.Sleep(binding.OpenTimeout + TimeSpan.FromSeconds(5));
OperationContextAsyncFlowTests.cs (8)
35int currentThreadId = Thread.CurrentThread.ManagedThreadId; 37Assert.NotEqual(currentThreadId, Thread.CurrentThread.ManagedThreadId); 70int currentThreadId = Thread.CurrentThread.ManagedThreadId; 72Assert.NotEqual(currentThreadId, Thread.CurrentThread.ManagedThreadId); 78currentThreadId = Thread.CurrentThread.ManagedThreadId; 80Assert.NotEqual(currentThreadId, Thread.CurrentThread.ManagedThreadId); 161int currentThreadId = Thread.CurrentThread.ManagedThreadId; 163Assert.NotEqual(currentThreadId, Thread.CurrentThread.ManagedThreadId);
Client.ClientBase.IntegrationTests (1)
SessionTests.cs (1)
186Thread.Sleep(TimeSpan.FromSeconds(10));
csc (3)
src\Compilers\Shared\BuildClient.cs (1)
187var thread = new Thread(action);
src\Compilers\Shared\BuildServerConnection.cs (2)
689Thread.Sleep(1); 780Thread.Sleep(1);
dotnet-openapi (1)
DebugMode.cs (1)
22Thread.Sleep(TimeSpan.FromSeconds(3));
dotnet-svcutil.xmlserializer (3)
Microsoft\Tools\ServiceModel\SvcUtil\Tool.cs (3)
96Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); 100(System.Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage)) 102Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
dotnet-svcutil-lib (1)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaSet.cs (1)
424Thread.Sleep(10); //Thread.Yield(); //Let the thread that holds the lock run
GetDocument.Insider (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
225var thread = new Thread(() =>
HttpStress (1)
Program.cs (1)
543Thread.Sleep(DisplayIntervalMilliseconds);
IdeBenchmarks (1)
InheritanceMargin\InheritanceMarginGlyphBenchmarks.cs (1)
165var mainThread = new Thread(() =>
IdeCoreBenchmarks (3)
IncrementalSourceGeneratorBenchmarks.cs (1)
162Thread.Sleep(5000);
NavigateToBenchmarks.cs (2)
107Thread.Sleep(10000); 182Thread.Sleep(1000);
IIS.Tests (1)
Utilities\TestServer.cs (1)
185Thread.Sleep(100);
InMemory.FunctionalTests (3)
src\Servers\Kestrel\shared\test\RevocationResponder.cs (3)
180Thread.Sleep(ResponseDelay); 198Thread.Sleep(ResponseDelay); 241Thread.Sleep(ResponseDelay);
InProcessWebSite (2)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Program.cs (2)
51Thread.Sleep(Timeout.Infinite); 65Thread.Sleep(Timeout.Infinite);
InteractiveHost.UnitTests (1)
InteractiveHostDesktopTests.cs (1)
1078Thread.Sleep(TimeSpan.FromSeconds(10));
InteractiveHost32 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
40var uiThread = new Thread(() =>
InteractiveHost64 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
40var uiThread = new Thread(() =>
Microsoft.Analyzers.Extra.Tests (1)
CallAnalysis\StaticTimeTests.cs (1)
17Assembly.GetAssembly(typeof(Thread))!,
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (1)
181if (Thread.CurrentThread.CurrentCulture.Parent.Name == "en")
Microsoft.AspNetCore.Components.Tests (44)
Rendering\RendererSynchronizationContextTest.cs (44)
20var thread = Thread.CurrentThread; 21Thread capturedThread = null; 28capturedThread = Thread.CurrentThread; 68var thread = Thread.CurrentThread; 69Thread capturedThread = null; 89capturedThread = Thread.CurrentThread; 205Thread capturedThread = null; 229capturedThread = Thread.CurrentThread; 245Assert.Same(Thread.CurrentThread, capturedThread); 250Assert.Same(Thread.CurrentThread, capturedThread); 296var thread = Thread.CurrentThread; 297Thread capturedThread = null; 302capturedThread = Thread.CurrentThread; 405var thread = Thread.CurrentThread; 406Thread capturedThread = null; 411capturedThread = Thread.CurrentThread; 424var thread = Thread.CurrentThread; 425Thread capturedThread = null; 444capturedThread = Thread.CurrentThread; 497var thread = Thread.CurrentThread; 502return Thread.CurrentThread; 514var thread = Thread.CurrentThread; 535return Thread.CurrentThread; 585var thread = Thread.CurrentThread; 586Thread capturedThread = null; 591capturedThread = Thread.CurrentThread; 605var thread = Thread.CurrentThread; 606Thread capturedThread = null; 625capturedThread = Thread.CurrentThread; 679var thread = Thread.CurrentThread; 684return Task.FromResult(Thread.CurrentThread); 696var thread = Thread.CurrentThread; 717return Task.FromResult(Thread.CurrentThread);
Microsoft.AspNetCore.Components.WebAssembly (2)
Hosting\WebAssemblyHostBuilder.cs (2)
205var currentThread = Thread.CurrentThread;
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\DefaultKeyResolver.cs (1)
144Thread.Sleep(_decryptRetryDelay);
Microsoft.AspNetCore.DataProtection.Tests (2)
KeyManagement\KeyRingProviderTests.cs (2)
688Thread foregroundThread = Thread.CurrentThread;
Microsoft.AspNetCore.Diagnostics.Tests (1)
ExceptionHandlerTest.cs (1)
495Thread.Sleep(1000);
Microsoft.AspNetCore.Hosting.Tests (1)
WebHostTests.cs (1)
334Thread.Sleep(1000);
Microsoft.AspNetCore.Hosting.TestSites (2)
StartupShutdown.cs (2)
23System.Threading.Thread.Sleep(200); 29System.Threading.Thread.Sleep(200);
Microsoft.AspNetCore.Mvc.Testing (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
225var thread = new Thread(() =>
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
FormatWeekHelper.cs (1)
21var calendar = Thread.CurrentThread.CurrentCulture.Calendar;
Microsoft.AspNetCore.OutputCaching.Tests (3)
OutputCacheKeyProviderTests.cs (3)
115var culture = Thread.CurrentThread.CurrentCulture; 118Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("fr-FR"); 124Thread.CurrentThread.CurrentCulture = culture;
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Common\RetryHelper.cs (1)
87Thread.Sleep(retryDelayMilliseconds);
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (2)
IISDeployer.cs (1)
498Thread.Sleep(delay);
IISExpressDeployer.cs (1)
534Thread.Sleep(100);
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Infrastructure\Heartbeat.cs (1)
18private readonly Thread _timerThread;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
src\Servers\Kestrel\shared\test\RevocationResponder.cs (3)
180Thread.Sleep(ResponseDelay); 198Thread.Sleep(ResponseDelay); 241Thread.Sleep(ResponseDelay);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
src\Servers\Kestrel\Transport.Sockets\src\Internal\IOQueue.cs (1)
47Thread.MemoryBarrier();
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
Internal\IOQueue.cs (1)
47Thread.MemoryBarrier();
Microsoft.AspNetCore.Session.Tests (1)
SessionTests.cs (1)
427Thread.Sleep(50);
Microsoft.AspNetCore.Shared.Tests (1)
ObjectMethodExecutorTest.cs (1)
599Thread.Sleep(100);
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Docker.cs (1)
83Thread.Sleep(1000);
Microsoft.AspNetCore.TestHost (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
225var thread = new Thread(() =>
Microsoft.AspNetCore.TestHost.Tests (2)
TestServerTests.cs (2)
741Thread.Sleep(1000); 768Thread.Sleep(1000);
Microsoft.Build (38)
AwaitExtensions.cs (1)
184Thread thread = new Thread(threadStart);
BackEnd\Client\MSBuildClient.cs (1)
298Thread.Sleep(100);
BackEnd\Client\MSBuildClientPacketPump.cs (1)
57private Thread? _packetPumpThread;
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (2)
1432file.WriteLine("{0}({1})-{2}: {3}", Thread.CurrentThread.Name, Thread.CurrentThread.ManagedThreadId, DateTime.UtcNow.Ticks, message);
BackEnd\Components\Communications\NodeEndpointInProc.cs (1)
79private Thread _packetPump;
BackEnd\Components\Communications\NodeProviderInProc.cs (1)
66private Thread _inProcNodeThread;
BackEnd\Components\Logging\LoggingService.cs (2)
273private Thread _loggingEventProcessingThread; 1464var pumpTask = _loggingEventProcessingThread;
BackEnd\Components\RequestBuilder\Lookup.cs (1)
1376_threadIdThatEnteredScope = Thread.CurrentThread.ManagedThreadId;
BackEnd\Components\RequestBuilder\RequestBuilder.cs (6)
722Thread.CurrentThread.Priority = _componentHost.BuildParameters.BuildThreadPriority; 723Thread.CurrentThread.IsBackground = true; 729if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA) 735if (string.IsNullOrEmpty(Thread.CurrentThread.Name)) 737Thread.CurrentThread.Name = threadName; 1482var thread = new Thread(() =>
BackEnd\Components\RequestBuilder\TaskBuilder.cs (3)
438&& (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 557Thread staThread = null; 859Thread.ResetAbort();
BackEnd\Components\RequestBuilder\TaskHost.cs (3)
360_yieldThreadId = Thread.CurrentThread.ManagedThreadId; 389ErrorUtilities.VerifyThrow(_yieldThreadId == Thread.CurrentThread.ManagedThreadId, "Cannot call Reacquire() on thread {0} when Yield() was called on thread {1}", Thread.CurrentThread.ManagedThreadId, _yieldThreadId);
BackEnd\Components\Scheduler\Scheduler.cs (2)
2573file.Write("{0}({1})-{2}: ", Thread.CurrentThread.Name, Thread.CurrentThread.ManagedThreadId, _schedulingData.EventTime.Ticks);
BackEnd\Node\OutOfProcServerNode.cs (2)
368Thread.CurrentThread.CurrentCulture = command.Culture; 369Thread.CurrentThread.CurrentUICulture = command.UICulture;
CommunicationsUtilities.cs (2)
844file.WriteLine("{0} (TID {1}) {2,15} +{3,10}ms: {4}", Thread.CurrentThread.Name, Thread.CurrentThread.ManagedThreadId, now, millisecondsSinceLastLog, message);
FileUtilities.cs (2)
906Thread.Sleep(retryTimeOut); 944Thread.Sleep(10);
Instance\RunningObjectTable.cs (2)
31if (Thread.CurrentThread.GetApartmentState() == ApartmentState.MTA) 60if (Thread.CurrentThread.GetApartmentState() == ApartmentState.MTA)
NodeEndpointOutOfProcBase.cs (2)
88private Thread _packetPump; 296ErrorUtilities.VerifyThrow(_packetPump.ManagedThreadId != Thread.CurrentThread.ManagedThreadId, "Can't join on the same thread.");
ThreadPoolExtensions.cs (4)
32Thread.CurrentThread.CurrentCulture = culture; 37Thread.CurrentThread.CurrentUICulture = uiCulture; 47Thread.CurrentThread.CurrentCulture = originalThreadCulture; 52Thread.CurrentThread.CurrentUICulture = originalThreadUICulture;
Microsoft.Build.CommandLine.UnitTests (12)
MSBuildServer_Tests.cs (1)
39Thread.Sleep(SleepTime);
TerminalLogger_Tests.cs (3)
56private readonly CultureInfo _originalCulture = Thread.CurrentThread.CurrentCulture; 70Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; 112Thread.CurrentThread.CurrentCulture = _originalCulture;
XMake_Tests.cs (8)
886Thread thisThread = Thread.CurrentThread; 918Thread thisThread = Thread.CurrentThread; 953Thread thisThread = Thread.CurrentThread; 1080Thread.Sleep(10); 1166Assert.Equal(new CultureInfo("en"), Thread.CurrentThread.CurrentUICulture);
Microsoft.Build.Engine.OM.UnitTests (2)
FileUtilities.cs (2)
906Thread.Sleep(retryTimeOut); 944Thread.Sleep(10);
Microsoft.Build.Engine.UnitTests (68)
BackEnd\BuildManager_Tests.cs (6)
386Thread.Sleep(3000); 1593Thread.Sleep(500); 1633Thread.Sleep(500); 1671Thread.Sleep(500); 1709Thread.Sleep(500); 1746Thread.Sleep(500);
BackEnd\BuildRequestEngine_Tests.cs (2)
57private Thread _builderThread; 96Thread.Sleep(1000);
BackEnd\LoggingService_Tests.cs (1)
1001Thread.Sleep(100);
BackEnd\NodeEndpointInProc_Tests.cs (10)
111_dataReceivedContext = new DataReceivedContext(Thread.CurrentThread, packet); 146public readonly Thread thread; 149public LinkStatusContext(Thread thread, LinkStatus status) 158public readonly Thread thread; 161public DataReceivedContext(Thread thread, INodePacket packet) 305Assert.Equal(_host.DataReceivedContext.thread.ManagedThreadId, Thread.CurrentThread.ManagedThreadId); 311Assert.Equal(_host.DataReceivedContext.thread.ManagedThreadId, Thread.CurrentThread.ManagedThreadId); 338Assert.NotEqual(_host.DataReceivedContext.thread.ManagedThreadId, Thread.CurrentThread.ManagedThreadId); 348Assert.NotEqual(_host.DataReceivedContext.thread.ManagedThreadId, Thread.CurrentThread.ManagedThreadId); 441_linkStatusTable[endpoint] = new LinkStatusContext(Thread.CurrentThread, status);
BackEnd\RequestBuilder_Tests.cs (2)
126Thread.Sleep(500); 207Thread.Sleep(500);
BackEnd\SdkResolverService_Tests.cs (2)
174Thread.Sleep(200); 711Thread.Sleep(10);
BackEnd\TargetBuilder_Tests.cs (1)
289Thread.Sleep(100);
BackEnd\TargetUpToDateChecker_Tests.cs (3)
423Thread.Sleep(100); 588Thread.Sleep(50); 604Thread.Sleep(50);
BackEnd\TaskHostConfiguration_Tests.cs (30)
46culture: Thread.CurrentThread.CurrentCulture, 47uiCulture: Thread.CurrentThread.CurrentUICulture, 81culture: Thread.CurrentThread.CurrentCulture, 82uiCulture: Thread.CurrentThread.CurrentUICulture, 116culture: Thread.CurrentThread.CurrentCulture, 117uiCulture: Thread.CurrentThread.CurrentUICulture, 188culture: Thread.CurrentThread.CurrentCulture, 189uiCulture: Thread.CurrentThread.CurrentUICulture, 214culture: Thread.CurrentThread.CurrentCulture, 215uiCulture: Thread.CurrentThread.CurrentUICulture, 241culture: Thread.CurrentThread.CurrentCulture, 242uiCulture: Thread.CurrentThread.CurrentUICulture, 273culture: Thread.CurrentThread.CurrentCulture, 274uiCulture: Thread.CurrentThread.CurrentUICulture, 305culture: Thread.CurrentThread.CurrentCulture, 306uiCulture: Thread.CurrentThread.CurrentUICulture, 344culture: Thread.CurrentThread.CurrentCulture, 345uiCulture: Thread.CurrentThread.CurrentUICulture, 441culture: Thread.CurrentThread.CurrentCulture, 442uiCulture: Thread.CurrentThread.CurrentUICulture, 492culture: Thread.CurrentThread.CurrentCulture, 493uiCulture: Thread.CurrentThread.CurrentUICulture, 541culture: Thread.CurrentThread.CurrentCulture, 542uiCulture: Thread.CurrentThread.CurrentUICulture, 589culture: Thread.CurrentThread.CurrentCulture, 590uiCulture: Thread.CurrentThread.CurrentUICulture, 644culture: Thread.CurrentThread.CurrentCulture, 645uiCulture: Thread.CurrentThread.CurrentUICulture, 694culture: Thread.CurrentThread.CurrentCulture, 695uiCulture: Thread.CurrentThread.CurrentUICulture,
Evaluation\Expander_Tests.cs (6)
4971var currentThread = Thread.CurrentThread; 5014var currentThread = Thread.CurrentThread; 5057var currentThread = Thread.CurrentThread;
Evaluation\ExpanderFunction_Tests.cs (2)
262Thread currentThread = Thread.CurrentThread;
FileUtilities_Tests.cs (3)
303var currentCulture = Thread.CurrentThread.CurrentCulture; 306Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR"); // Turkish 314Thread.CurrentThread.CurrentCulture = currentCulture;
Microsoft.Build.Framework (1)
BuildEventArgs.cs (1)
91threadId = System.Threading.Thread.CurrentThread.GetHashCode();
Microsoft.Build.Tasks.CodeAnalysis (2)
src\Compilers\Shared\BuildServerConnection.cs (2)
689Thread.Sleep(1); 780Thread.Sleep(1);
Microsoft.Build.Tasks.Core (8)
BootstrapperUtil\ResourceUpdater.cs (1)
57Thread.Sleep(beginUpdateRetryInterval);
BootstrapperUtil\Util.cs (1)
77public static CultureInfo DefaultCultureInfo => System.Threading.Thread.CurrentThread.CurrentUICulture;
Copy.cs (2)
981Thread.Sleep(RetryDelayMilliseconds); 1007Thread.Sleep(RetryDelayMilliseconds);
Delete.cs (1)
155Thread.Sleep(RetryDelayMilliseconds);
FileUtilities.cs (2)
906Thread.Sleep(retryTimeOut); 944Thread.Sleep(10);
ManifestUtil\SecurityUtil.cs (1)
803System.Threading.Thread.Sleep(50);
Microsoft.Build.Tasks.UnitTests (11)
GetSDKReference_Tests.cs (3)
614Thread.Sleep(100); 640Thread.Sleep(100); 648Thread.Sleep(100);
ResourceHandling\GenerateResource_Tests.cs (8)
422System.Threading.Thread.Sleep(200); 697System.Threading.Thread.Sleep(200); 702System.Threading.Thread.Sleep(1000); 709System.Threading.Thread.Sleep(1000); 760System.Threading.Thread.Sleep(500); 819System.Threading.Thread.Sleep(200); 912System.Threading.Thread.Sleep(1100); 3700System.Threading.Thread.Sleep(NativeMethodsShared.IsOSX ? 1000 : 100);
Microsoft.Build.Utilities.Core (3)
FileUtilities.cs (2)
906Thread.Sleep(retryTimeOut); 944Thread.Sleep(10);
ToolTask.cs (1)
1063Thread.Sleep(50);
Microsoft.Build.Utilities.UnitTests (3)
CommandLineBuilder_Tests.cs (3)
62var currentCulture = Thread.CurrentThread.CurrentCulture; 65Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR"); // Turkish 73Thread.CurrentThread.CurrentCulture = currentCulture;
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
22if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (4)
CommandLineTests.cs (4)
1864var originalCulture = Thread.CurrentThread.CurrentCulture; 1865Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR", useUserOverride: false); 1868Thread.CurrentThread.CurrentCulture = originalCulture; 2902var currentUICultureName = Thread.CurrentThread.CurrentUICulture.Name;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Workspaces\WorkspaceTests_EditorFeatures.cs (2)
569Thread.Sleep(1000); 640Thread.Sleep(1000);
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (3)
EmbeddedLanguages\Json\CSharpJsonParserTests.cs (2)
90if (Thread.CurrentThread.CurrentCulture.Name == SupportedLanguage) 205if (Thread.CurrentThread.CurrentCulture.Name == SupportedLanguage)
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (1)
133if (Thread.CurrentThread.CurrentCulture.Name == "en-US")
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
Emit\CompilationEmitTests.cs (1)
1915Thread.Sleep(TimeSpan.FromSeconds(3));
Emit\DeterministicTests.cs (1)
61Thread.Sleep(TimeSpan.FromSeconds(1));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\EditAndContinue\SymbolMatcherTests.cs (1)
101Thread.Sleep(10);
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
EndToEndTests.cs (1)
40var thread = new System.Threading.Thread(() =>
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (13)
Semantics\SemanticErrorTests.cs (6)
1695var savedCurrentCulture = Thread.CurrentThread.CurrentCulture; 1696var savedCurrentUICulture = Thread.CurrentThread.CurrentUICulture; 1697Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; 1698Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; 1712Thread.CurrentThread.CurrentCulture = savedCurrentCulture; 1713Thread.CurrentThread.CurrentUICulture = savedCurrentUICulture;
SourceGeneration\GeneratorDriverTests.cs (4)
3550Thread.Sleep(1); 3581Thread.Sleep(1); 3590Thread.Sleep(1); 3628Thread.Sleep(50);
SourceGeneration\SyntaxAwareGeneratorTests.cs (3)
2087ctx.RegisterSourceOutput(ctx.SyntaxProvider.CreateSyntaxProvider<object>((s, _) => s is AssignmentExpressionSyntax, (c, _) => { Thread.Sleep(sleepTimeInMs); return true; }), (spc, s) => { }); 2092ctx.RegisterSourceOutput(ctx.SyntaxProvider.CreateSyntaxProvider<object>((s, _) => s is AssignmentExpressionSyntax, (c, _) => { Thread.Sleep(sleepTimeInMs); return true; }), (spc, s) => { }); 2093ctx.RegisterSourceOutput(ctx.SyntaxProvider.CreateSyntaxProvider<object>((s, _) => s is AssignmentExpressionSyntax, (c, _) => { Thread.Sleep(sleepTimeInMs); return true; }), (spc, s) => { });
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\GetSemanticInfoTests.cs (4)
3279Thread[] threads = new Thread[4]; 3285foreach (Thread t in threads) 3290foreach (Thread t in threads)
Microsoft.CodeAnalysis.EditorFeatures (3)
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ReferenceCounting.cs (3)
67private Thread? _thread; 80_thread = Thread.CurrentThread; 84=> Contract.ThrowIfFalse(Thread.CurrentThread == _thread);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Threading\StaTaskScheduler.cs (1)
23public Thread StaThread { get; }
Threading\WpfTestRunner.cs (1)
59Debug.Assert(sta.StaThread == Thread.CurrentThread);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
Utilities\AsynchronousOperationListenerTests.cs (1)
66Thread.Sleep(TimeSpan.FromMilliseconds(10));
Utilities\PatternMatcherTests.cs (3)
404var previousCulture = Thread.CurrentThread.CurrentCulture; 406Thread.CurrentThread.CurrentCulture = turkish; 417Thread.CurrentThread.CurrentCulture = previousCulture;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
IntelliSense\CSharpCompletionCommandHandlerTests.vb (2)
5193Thread.Sleep(250) 5270Thread.Sleep(250)
Microsoft.CodeAnalysis.InteractiveHost (3)
Interactive\Core\InteractiveHost.RemoteService.cs (2)
35private Thread? _readOutputThread; // nulled on dispose 36private Thread? _readErrorOutputThread; // nulled on dispose
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
22if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Ordering\LongRunningNonMutatingRequestHandler.cs (1)
40Thread.Sleep(100);
Microsoft.CodeAnalysis.Test.Utilities (2)
Assert\UseCultureAttribute.cs (1)
17/// <see cref="Thread.CurrentThread" /> <see cref="CultureInfo.CurrentCulture" /> and
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
1172Thread.Sleep(10);
Microsoft.CodeAnalysis.UnitTests (3)
CommonCommandLineParserTests.cs (3)
53CultureInfo saveUICulture = Thread.CurrentThread.CurrentUICulture; 64Thread.CurrentThread.CurrentUICulture = preferred; 81Thread.CurrentThread.CurrentUICulture = saveUICulture;
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
CommandLineTests.vb (1)
2900Dim currentUICultureName = Thread.CurrentThread.CurrentUICulture.Name
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (8)
CodeGen\AnonymousTypesCodeGenTests.vb (6)
372Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 373System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture 425System.Threading.Thread.CurrentThread.CurrentCulture = currCulture 772Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 773System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture 812System.Threading.Thread.CurrentThread.CurrentCulture = currCulture
Emit\DeterministicTests.vb (1)
26Thread.Sleep(TimeSpan.FromSeconds(1))
Emit\EditAndContinue\SymbolMatcherTests.vb (1)
70Thread.Sleep(10)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (12)
Semantics\BinaryOperators.vb (9)
27Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 28System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US", useUserOverride:=False) 57System.Threading.Thread.CurrentThread.CurrentCulture = currCulture 66Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 67System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US", useUserOverride:=False) 233System.Threading.Thread.CurrentThread.CurrentCulture = currCulture 388Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 389System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US", useUserOverride:=False) 501System.Threading.Thread.CurrentThread.CurrentCulture = currCulture
Semantics\Conversions.vb (3)
3288Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture 3289System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US") 3459System.Threading.Thread.CurrentThread.CurrentCulture = currCulture
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (11)
SymbolDisplay\ObjectDisplayTests.vb (1)
6Imports System.Threading.Thread
SymbolDisplay\SymbolDisplayTests.vb (10)
3196Dim oldCulture = Thread.CurrentThread.CurrentCulture 3198Thread.CurrentThread.CurrentCulture = CType(oldCulture.Clone(), CultureInfo) 3199Thread.CurrentThread.CurrentCulture.NumberFormat.NegativeSign = "~" 3200Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = "," 3215Thread.CurrentThread.CurrentCulture = oldCulture 3238Dim oldCulture = Thread.CurrentThread.CurrentCulture 3240Thread.CurrentThread.CurrentCulture = CType(oldCulture.Clone(), CultureInfo) 3241Thread.CurrentThread.CurrentCulture.NumberFormat.NegativeSign = "~" 3242Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = "," 3257Thread.CurrentThread.CurrentCulture = oldCulture
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (1)
Scanner\ScannerTests.vb (1)
6Imports System.Threading.Thread
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
22if (Thread.CurrentThread.IsThreadPoolThread)
Workspace\Solution\TextLoader.cs (1)
154Thread.Sleep(RetryDelay);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (7)
TestExportJoinableTaskContext.cs (3)
48Thread mainThread; 57mainThread = Thread.CurrentThread; 116var thread = joinableTaskFactory.Context.MainThread;
TestExportJoinableTaskContext+DenyExecutionSynchronizationContext.cs (4)
57private DenyExecutionSynchronizationContext(SynchronizationContext? underlyingContext, Thread? mainThread, StrongBox<ExceptionDispatchInfo>? failedTransfer) 72/// Gets the <see cref="Thread"/> to treat as the main thread. 76/// used for checking if <see cref="Thread.CurrentThread"/> matches a known "main thread", and ensures that 79internal Thread MainThread
Microsoft.CodeAnalysis.Workspaces.UnitTests (16)
CodeCleanup\FixIncorrectTokenTests.cs (3)
715var savedCulture = System.Threading.Thread.CurrentThread.CurrentCulture; 719System.Threading.Thread.CurrentThread.CurrentCulture = 729System.Threading.Thread.CurrentThread.CurrentCulture = savedCulture;
CodeCleanup\ReduceTokenTests.cs (7)
1723var savedCulture = System.Threading.Thread.CurrentThread.CurrentCulture; 1727System.Threading.Thread.CurrentThread.CurrentCulture = 1751System.Threading.Thread.CurrentThread.CurrentCulture = savedCulture; 1758var oldCulture = Thread.CurrentThread.CurrentCulture; 1761Thread.CurrentThread.CurrentCulture = (CultureInfo)oldCulture.Clone(); 1762Thread.CurrentThread.CurrentCulture.NumberFormat.NegativeSign = "~"; 1785Thread.CurrentThread.CurrentCulture = oldCulture;
UtilityTest\AsyncLazyTests.cs (6)
66Thread? synchronousRequestThread = null; 71synchronousRequestThread = Thread.CurrentThread; 91var currentSynchronousRequestThread = synchronousRequestThread; 93asyncContinuationRanSynchronously = currentSynchronousRequestThread != null && currentSynchronousRequestThread == Thread.CurrentThread; 378Thread.Yield(); 410Thread.Yield();
Microsoft.Data.Analysis.Tests (1)
test\Microsoft.ML.TestFramework\BaseTestClass.cs (1)
47Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Microsoft.DotNet.Arcade.Sdk.Tests (1)
Utilities\TestApp.cs (1)
127Thread.Sleep(500);
Microsoft.DotNet.AsmDiff (2)
Program.cs (2)
94Thread.CurrentThread.CurrentCulture = cultureInfo; 95Thread.CurrentThread.CurrentUICulture = cultureInfo;
Microsoft.DotNet.Build.Tasks.Packaging (1)
NuGetUtility.cs (1)
52Thread.Sleep(5000);
Microsoft.DotNet.XliffTasks (1)
ExponentialRetry.cs (1)
31Thread.Sleep(t);
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (8)
Infrastructure\RedisTestConfig.cs (1)
180Thread.Sleep(3000); // to give server time to initialize
TimeExpirationTests.cs (7)
52Thread.Sleep(TimeSpan.FromSeconds(0.5)); 119Thread.Sleep(TimeSpan.FromSeconds(0.5)); 180Thread.Sleep(TimeSpan.FromSeconds(3.5)); 213Thread.Sleep(TimeSpan.FromSeconds(0.5)); 219Thread.Sleep(TimeSpan.FromSeconds(3)); 241Thread.Sleep(TimeSpan.FromSeconds(0.5)); 250Thread.Sleep(TimeSpan.FromSeconds(0.5));
Microsoft.Extensions.Configuration.FileExtensions (1)
FileConfigurationProvider.cs (1)
38Thread.Sleep(Source.ReloadDelay);
Microsoft.Extensions.Configuration.KeyPerFile (1)
KeyPerFileConfigurationProvider.cs (1)
35Thread.Sleep(Source.ReloadDelay);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (4)
Linux\LinuxCountersTests.cs (2)
142Thread.Sleep(3000); 154Thread.Sleep(3000);
Windows\Tcp6TableInfoTests.cs (1)
305Thread.Sleep(6000);
Windows\TcpTableInfoTests.cs (1)
248Thread.Sleep(6000);
Microsoft.Extensions.Diagnostics.Testing.Tests (4)
Logging\FakeLoggerTests.cs (3)
121var oldCulture = Thread.CurrentThread.CurrentCulture; 122Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("fr-CA"); 142Thread.CurrentThread.CurrentCulture = oldCulture;
Metrics\MetricCollectorTests.cs (1)
371Thread.Sleep(2000);
Microsoft.Extensions.Hosting.WindowsServices (1)
WindowsServiceLifetime.cs (1)
89Thread thread = new Thread(Run);
Microsoft.Extensions.Logging.Console (1)
ConsoleLoggerProcessor.cs (1)
58private readonly Thread _outputThread;
Microsoft.Extensions.ML (1)
ModelLoaders\FileModelLoader.cs (1)
124Thread.Sleep(50);
Microsoft.Extensions.ObjectPool.Microbenchmark (2)
DrainRefillMultiTheaded.cs (1)
55Thread.Sleep(250);
GetReturnMultiThreaded.cs (1)
47Thread.Sleep(250);
Microsoft.Extensions.ObjectPool.Tests (1)
ThreadingTest.cs (1)
33var threads = new Thread[8];
Microsoft.Extensions.Telemetry.Tests (1)
Enrichment\ProcessLogEnricherTests.cs (1)
63Assert.Equal(Thread.CurrentThread.ManagedThreadId.ToString(CultureInfo.InvariantCulture), enrichedState[ProcessEnricherTagNames.ThreadId]);
Microsoft.Extensions.TimeProvider.Testing.Tests (1)
FakeTimeProviderTests.cs (1)
506var th = new Thread(() => provider.GetUtcNow());
Microsoft.Gen.Logging.Generated.Tests (3)
LogMethodTests.cs (3)
829var oldCulture = Thread.CurrentThread.CurrentCulture; 830Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("fr-CA"); 836Thread.CurrentThread.CurrentCulture = oldCulture;
Microsoft.Maui.Graphics (1)
PdfExportContext.cs (1)
22 if ("en-US".Equals(Thread.CurrentThread.CurrentCulture.Name, StringComparison.Ordinal))
Microsoft.Maui.Resizetizer (6)
AsyncTask.cs (5)
59 uiThreadId = Thread.CurrentThread.ManagedThreadId; 108 if (uiThreadId == Thread.CurrentThread.ManagedThreadId) 137 if (uiThreadId == Thread.CurrentThread.ManagedThreadId) 182 if (uiThreadId == Thread.CurrentThread.ManagedThreadId) 216 if (uiThreadId == Thread.CurrentThread.ManagedThreadId)
SkiaSharpTools.cs (1)
224 Thread.Sleep(delay);
Microsoft.ML.AutoML.Tests (6)
TunerTests.cs (6)
393var originalCuture = Thread.CurrentThread.CurrentCulture; 395Thread.CurrentThread.CurrentCulture = usCulture; 397Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator.Should().Be("."); 409Thread.CurrentThread.CurrentCulture = frCulture; 410Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator.Should().Be(","); 421Thread.CurrentThread.CurrentCulture = originalCuture;
Microsoft.ML.CodeGenerator.Tests (3)
TrainerGeneratorTests.cs (3)
39var currentCulture = Thread.CurrentThread.CurrentCulture; 40Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE"); 45Thread.CurrentThread.CurrentCulture = currentCulture;
Microsoft.ML.Core (2)
Utilities\ThreadUtils.cs (2)
21public static Thread RunOnForegroundThread(ParameterizedThreadStart start) => 72var t = new Thread(() =>
Microsoft.ML.Core.Tests (1)
UnitTests\TestHosts.cs (1)
41var addThread = new Thread(
Microsoft.ML.FastTree (3)
SumupPerformanceCommand.cs (3)
282Thread[] threadPool = new Thread[_parallel]; 291Thread thread = threadPool[t] = Utils.RunOnForegroundThread((object io) =>
Microsoft.ML.IntegrationTests (1)
IntegrationTestBaseClass.cs (1)
39Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Microsoft.ML.PerformanceTests (1)
Program.cs (1)
20Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Microsoft.ML.Samples (3)
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
338Thread.Sleep(200);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
294Thread.Sleep(200);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
315Thread.Sleep(200);
Microsoft.ML.Samples.GPU (3)
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
338Thread.Sleep(200);
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
294Thread.Sleep(200);
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
315Thread.Sleep(200);
Microsoft.ML.SearchSpace.Tests (3)
ParameterTest.cs (3)
126var originalCuture = Thread.CurrentThread.CurrentCulture; 128Thread.CurrentThread.CurrentCulture = culture; 133Thread.CurrentThread.CurrentCulture = originalCuture;
Microsoft.ML.Sweeper.Tests (1)
TestSweeper.cs (1)
339Thread.Sleep(sleeps[i]);
Microsoft.ML.TestFramework (2)
BaseTestBaseline.cs (1)
966var t = new Thread(() =>
BaseTestClass.cs (1)
47Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Microsoft.ML.Tests (6)
TrainerEstimators\TreeEstimators.cs (3)
777var currentCulture = Thread.CurrentThread.CurrentCulture; 778Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE"); 786Thread.CurrentThread.CurrentCulture = currentCulture;
Transformers\LineParserTests.cs (3)
54var currentCulture = Thread.CurrentThread.CurrentCulture; 55Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE"); 73Thread.CurrentThread.CurrentCulture = currentCulture;
Microsoft.ML.Tokenizers.Data.Tests (1)
src\Common\tests\RetryHelper.cs (1)
65Thread.Sleep((backoffFunc ?? _defaultBackoffFunc)(i));
Microsoft.ML.Tokenizers.Tests (1)
src\Common\tests\RetryHelper.cs (1)
65Thread.Sleep((backoffFunc ?? _defaultBackoffFunc)(i));
Microsoft.VisualBasic.Core (9)
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (1)
136nfi = Threading.Thread.CurrentThread.CurrentCulture.NumberFormat
Microsoft\VisualBasic\CompilerServices\Utils.vb (2)
69Return System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat 77Return System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ANSICodePage
Microsoft\VisualBasic\CompilerServices\VB6File.vb (1)
2112NegativeSign = Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NegativeSign
Microsoft\VisualBasic\DateAndTime.vb (1)
134Return Threading.Thread.CurrentThread.CurrentCulture.Calendar
Microsoft\VisualBasic\Strings.vb (4)
519Return Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToLower(Value) 528Return Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToLower(Value) 1043Return Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToUpper(Value) 1052Return Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToUpper(Value)
Microsoft.VisualBasic.Forms (9)
Microsoft\VisualBasic\ApplicationServices\ApplicationBase.vb (4)
30Return Thread.CurrentThread.CurrentCulture 74Return Thread.CurrentThread.CurrentUICulture 86Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(cultureName) 98Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName)
Microsoft\VisualBasic\ApplicationServices\User.vb (2)
31Return Thread.CurrentPrincipal 34Thread.CurrentPrincipal = value
Microsoft\VisualBasic\ApplicationServices\WindowsFormsApplicationBase.vb (1)
163Thread.CurrentPrincipal = New Principal.WindowsPrincipal(ntIdentity)
Microsoft\VisualBasic\CompilerServices\ExceptionUtils.vb (1)
111Return String.Format(Thread.CurrentThread.CurrentCulture, resourceKey, args)
Microsoft\VisualBasic\Interaction.vb (1)
221If Thread.CurrentThread.GetApartmentState() <> ApartmentState.STA Then
Microsoft.VisualBasic.Tests (20)
Microsoft\VisualBasic\ApplicationServices\ApplicationBaseTests.cs (6)
13Assert.Equal(Thread.CurrentThread.CurrentCulture, culture); 17Assert.Equal(Thread.CurrentThread.CurrentCulture, app.Culture); 22Thread.CurrentThread.CurrentCulture = culture; 31Assert.Equal(Thread.CurrentThread.CurrentUICulture, culture); 35Assert.Equal(Thread.CurrentThread.CurrentUICulture, app.UICulture); 40Thread.CurrentThread.CurrentUICulture = culture;
Microsoft\VisualBasic\ApplicationServices\SingleInstanceTests.cs (4)
107Thread.Sleep(100); 115Thread.Sleep(10); 231Thread.Sleep(100); 343Thread.Sleep(500);
Microsoft\VisualBasic\ApplicationServices\UserTests.cs (4)
12Assert.Equal(Thread.CurrentPrincipal, user.CurrentPrincipal); 15Assert.Equal(Thread.CurrentPrincipal.Identity.Name, user.Name); 16Assert.Equal(Thread.CurrentPrincipal.Identity.IsAuthenticated, user.IsAuthenticated); 17Assert.Equal(Thread.CurrentPrincipal.IsInRole("Guest"), user.IsInRole("Guest"));
Microsoft\VisualBasic\Devices\ClockTests.cs (5)
14Thread.Sleep(10); 17Thread.Sleep(10); 31Thread.Sleep(10); 34Thread.Sleep(10); 48Thread.Sleep(10);
Microsoft\VisualBasic\MyServices\Internal\ContextValueTests.cs (1)
37Thread thread = new(() =>
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
CodeModel\MethodXML\MethodXMLTests_VBAssignments.vb (2)
869Dim currentThread = Thread.CurrentThread 934Dim currentThread = Thread.CurrentThread
MSBuild (21)
CommunicationsUtilities.cs (2)
844file.WriteLine("{0} (TID {1}) {2,15} +{3,10}ms: {4}", Thread.CurrentThread.Name, Thread.CurrentThread.ManagedThreadId, now, millisecondsSinceLastLog, message);
FileUtilities.cs (2)
906Thread.Sleep(retryTimeOut); 944Thread.Sleep(10);
NodeEndpointOutOfProcBase.cs (2)
88private Thread _packetPump; 296ErrorUtilities.VerifyThrow(_packetPump.ManagedThreadId != Thread.CurrentThread.ManagedThreadId, "Can't join on the same thread.");
OutOfProcTaskAppDomainWrapperBase.cs (3)
232Thread staThread = new Thread(taskRunnerDelegate); 235staThread.CurrentCulture = Thread.CurrentThread.CurrentCulture; 236staThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
OutOfProcTaskHostNode.cs (3)
137private Thread _taskRunnerThread; 918Thread.CurrentThread.CurrentCulture = taskConfiguration.Culture; 919Thread.CurrentThread.CurrentUICulture = taskConfiguration.UICulture;
PerformanceLogEventListener.cs (1)
146s_builder.Append($"[{DateTime.UtcNow.ToString("o")}] Event={eventData.EventSource.Name}/{eventData.EventName} ProcessID={_processIDStr} ThreadID={System.Threading.Thread.CurrentThread.ManagedThreadId}\t ");
TerminalLogger\TerminalLogger.cs (1)
144private Thread? _refresher;
ThreadPoolExtensions.cs (4)
32Thread.CurrentThread.CurrentCulture = culture; 37Thread.CurrentThread.CurrentUICulture = uiCulture; 47Thread.CurrentThread.CurrentCulture = originalThreadCulture; 52Thread.CurrentThread.CurrentUICulture = originalThreadUICulture;
XMake.cs (3)
1897Thread thisThread = Thread.CurrentThread; 2534Thread.Sleep(100);
MSBuildTaskHost (33)
CommunicationsUtilities.cs (2)
844file.WriteLine("{0} (TID {1}) {2,15} +{3,10}ms: {4}", Thread.CurrentThread.Name, Thread.CurrentThread.ManagedThreadId, now, millisecondsSinceLastLog, message);
Concurrent\ConcurrentDictionary.cs (1)
138Thread.MemoryBarrier();
Concurrent\ConcurrentQueue.cs (20)
54internal static object VolatileReader(ref object o) => Thread.VolatileRead(ref o); 215Thread.MemoryBarrier(); 236Thread.MemoryBarrier(); 352int tail = Thread.VolatileRead(ref _headAndTail.Tail); 357Thread.SpinWait(1); 369int currentHead = Thread.VolatileRead(ref _headAndTail.Head); 373int sequenceNumber = Thread.VolatileRead(ref _slots[slotsIndex].SequenceNumber); 393if (Thread.VolatileRead(ref _preservedForObservation) == 0) 399Thread.VolatileWrite(ref _slots[slotsIndex].SequenceNumber, currentHead + _slots.Length); 414int currentTail = Thread.VolatileRead(ref _headAndTail.Tail); 427Thread.SpinWait(1); 441Thread.MemoryBarrier(); 448int currentHead = Thread.VolatileRead(ref _headAndTail.Head); 452int sequenceNumber = Thread.VolatileRead(ref _slots[slotsIndex].SequenceNumber); 472int currentTail = Thread.VolatileRead(ref _headAndTail.Tail); 485Thread.SpinWait(1); 500int currentTail = Thread.VolatileRead(ref _headAndTail.Tail); 504int sequenceNumber = Thread.VolatileRead(ref _slots[slotsIndex].SequenceNumber); 524Thread.VolatileWrite(ref _slots[slotsIndex].SequenceNumber, currentTail + 1); 539Thread.SpinWait(1);
FileUtilities.cs (2)
906Thread.Sleep(retryTimeOut); 944Thread.Sleep(10);
NodeEndpointOutOfProcBase.cs (2)
88private Thread _packetPump; 296ErrorUtilities.VerifyThrow(_packetPump.ManagedThreadId != Thread.CurrentThread.ManagedThreadId, "Can't join on the same thread.");
OutOfProcTaskAppDomainWrapperBase.cs (3)
232Thread staThread = new Thread(taskRunnerDelegate); 235staThread.CurrentCulture = Thread.CurrentThread.CurrentCulture; 236staThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
OutOfProcTaskHostNode.cs (3)
137private Thread _taskRunnerThread; 918Thread.CurrentThread.CurrentCulture = taskConfiguration.Culture; 919Thread.CurrentThread.CurrentUICulture = taskConfiguration.UICulture;
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1172[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Thread))]
netstandard (1)
netstandard.cs (1)
2133[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Thread))]
PresentationCore (35)
System\Windows\clipboard.cs (6)
64Thread.Sleep(OleRetryDelay); 153Thread.Sleep(OleRetryDelay); 386Thread.Sleep(OleRetryDelay); 495Thread.Sleep(OleRetryDelay); 504Thread.Sleep(OleFlushDelay); 605Thread.Sleep(OleRetryDelay);
System\Windows\Input\InputManager.cs (1)
143if(Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
System\Windows\Input\InputMethod.cs (1)
417Dispatcher dispatcher = Dispatcher.FromThread(Thread.CurrentThread);
System\Windows\Input\InputProcessorProfiles.cs (1)
63Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Initialize called on MTA thread!");
System\Windows\Input\InputProcessorProfilesLoader.cs (1)
57Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Load called on MTA thread!");
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (2)
294Thread inkingThread = new Thread(new ThreadStart(InkingThreadProc)); 308Thread.CurrentThread.Name = "DynamicRenderer";
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (2)
482Thread thread = new Thread(new ThreadStart(ThreadProc)) 1144Thread.CurrentThread.Name = "Stylus Input";
System\Windows\Input\TextServicesContext.cs (1)
47Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "SetDispatcherThreaad on MTA thread");
System\Windows\InterOp\HwndSource.cs (3)
25_threadSlot = Thread.AllocateDataSlot(); 2675object obj = Thread.GetData(_threadSlot); 2679Thread.SetData(_threadSlot, data);
System\Windows\Media\Effects\BitmapEffect.cs (1)
27if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
System\Windows\Media\HostVisual.cs (3)
136Debug.Assert(target.Dispatcher.Thread == Thread.CurrentThread); 189Debug.Assert(_target.Dispatcher.Thread == Thread.CurrentThread); 322Dispatcher channelDispatcher = Dispatcher.FromThread(Thread.CurrentThread);
System\Windows\Media\Imaging\BitmapDownload.cs (1)
441private static Thread _thread;
System\Windows\OleServicesContext.cs (12)
75oleServicesContext = (OleServicesContext)Thread.GetData(OleServicesContext._threadDataSlot); 83Thread.SetData(OleServicesContext._threadDataSlot, oleServicesContext); 105if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 118if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 131if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 147if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 161if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 189if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 202if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 228if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 258if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 302private static readonly LocalDataStoreSlot _threadDataSlot = Thread.AllocateDataSlot();
PresentationCore.Tests (1)
BinaryFormat\DataObjectTests.cs (1)
14Thread testThread = new Thread(() => TestLogic(value));
PresentationFramework (34)
Microsoft\Win32\CommonDialog.cs (3)
231if (_thread != Thread.CurrentThread) 319private readonly Thread _thread = Thread.CurrentThread;
MS\Internal\Data\ClrBindingWorker.cs (2)
389if (Dispatcher.Thread == Thread.CurrentThread) 414if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Controls\CalendarBlackoutDatesCollection.cs (3)
19private Thread _dispatcherThread; 31this._dispatcherThread = Thread.CurrentThread; 340return Thread.CurrentThread == this._dispatcherThread;
System\Windows\Controls\Grid.cs (3)
3072WeakReference tempDefinitionsWeakRef = (WeakReference)Thread.GetData(s_tempDefinitionsDataSlot); 3076Thread.SetData(s_tempDefinitionsDataSlot, new WeakReference(extData.TempDefinitions)); 3281private static readonly LocalDataStoreSlot s_tempDefinitionsDataSlot = Thread.AllocateDataSlot();
System\Windows\Controls\SelectedDatesCollection.cs (3)
20private Thread _dispatcherThread; 34this._dispatcherThread = Thread.CurrentThread; 470return Thread.CurrentThread == this._dispatcherThread;
System\Windows\Controls\SpellCheck.cs (1)
142new FrameworkPropertyMetadata(Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "de" ? SpellingReform.Postreform : SpellingReform.PreAndPostreform,
System\Windows\Controls\WebBrowser.cs (2)
292HRESULT hr = scriptObjectEx.GetIDsOfNames(ref guid, names, 1, Thread.CurrentThread.CurrentCulture.LCID, dispids); 320Thread.CurrentThread.CurrentCulture.LCID,
System\Windows\Data\BindingExpression.cs (1)
2497if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Data\BindingExpressionBase.cs (1)
433if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Data\BindingGroup.cs (1)
1500if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Documents\Speller.cs (1)
51Thread.CurrentThread.CurrentCulture;
System\windows\Documents\TextEditor.cs (3)
1351store = (TextEditorThreadLocalStore)Thread.GetData(_threadLocalStoreSlot); 1356Thread.SetData(_threadLocalStoreSlot, store); 2030private static LocalDataStoreSlot _threadLocalStoreSlot = Thread.AllocateDataSlot();
System\Windows\Documents\TextServicesHost.cs (4)
62Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "OnRegisterTextStore must be called on STA thread"); 67_thread = Thread.CurrentThread; 373if (_thread == Thread.CurrentThread || System.Environment.OSVersion.Version.Major >= 6) 413private Thread _thread;
System\Windows\Documents\TextStore.cs (1)
2418Invariant.Assert(Thread.CurrentThread == _textservicesHost.Dispatcher.Thread, "GrantLock called on bad thread!");
System\Windows\Documents\WinRTSpellerInterop.cs (1)
55_defaultCulture = InputLanguageManager.Current?.CurrentInputLanguage ?? Thread.CurrentThread.CurrentCulture;
System\Windows\Interop\ActiveXHost.cs (1)
86if (Thread.CurrentThread.ApartmentState != ApartmentState.STA)
System\Windows\Standard\Debug.cs (1)
339if (Thread.CurrentThread.GetApartmentState() != expectedState)
System\Windows\Standard\Verify.cs (1)
41if (Thread.CurrentThread.GetApartmentState() != requiredState)
System\Windows\SystemResources.cs (1)
1303Dispatcher dispatcher = isSysColorsOrSettingsChange ? null : Dispatcher.FromThread(System.Threading.Thread.CurrentThread);
PresentationUI (1)
MS\Internal\Documents\SigningProgress.cs (1)
52Thread dialogThread = new Thread(
ReachFramework (8)
PrintConfig\PTProvider.cs (3)
184this._thread = Thread.CurrentThread; 560if(_thread != Thread.CurrentThread) 847private Thread _thread;
PrintConfig\PTUtility.cs (1)
41return _resManager.GetString(key, System.Threading.Thread.CurrentThread.CurrentUICulture);
PrintSystemExceptions\PrintSystemException.cs (4)
222System.Threading.Thread.CurrentThread.CurrentUICulture); 241System.Threading.Thread.CurrentThread.CurrentUICulture); 245exceptionMessage = String.Format(System.Threading.Thread.CurrentThread.CurrentUICulture, 251exceptionMessage = String.Format(System.Threading.Thread.CurrentThread.CurrentUICulture,
Replay (2)
src\Compilers\Shared\BuildServerConnection.cs (2)
689Thread.Sleep(1); 780Thread.Sleep(1);
ScenarioTests.Common.Tests (2)
ThreadHoppingSynchronizationContext.cs (2)
15var t = new Thread(CallbackRunner); 21var t = new Thread(CallbackRunner);
System.Collections.Concurrent (1)
System\Collections\Concurrent\BlockingCollection.cs (1)
1663((collections.Length == 63) && (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA)))
System.ComponentModel.Composition (13)
System\ComponentModel\Composition\Hosting\AssemblyCatalog.cs (1)
449Thread.MemoryBarrier();
System\ComponentModel\Composition\Hosting\CatalogExportProvider.CatalogExport.cs (1)
141Thread.MemoryBarrier();
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (1)
625Thread.MemoryBarrier();
System\ComponentModel\Composition\Hosting\CatalogExportProvider.ScopeFactoryExport.cs (2)
62Thread.MemoryBarrier(); 88Thread.MemoryBarrier();
System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs (1)
163Thread.MemoryBarrier();
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (1)
526Thread.MemoryBarrier();
System\ComponentModel\Composition\Hosting\FilteredCatalog.cs (1)
112Thread.MemoryBarrier();
System\ComponentModel\Composition\Hosting\TypeCatalog.cs (1)
275Thread.MemoryBarrier();
System\ComponentModel\Composition\ReflectionModel\ExportingMember.cs (1)
78Thread.MemoryBarrier();
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (3)
88Thread.MemoryBarrier(); 169Thread.MemoryBarrier(); 482Thread.MemoryBarrier();
System.Configuration.ConfigurationManager (1)
System\Configuration\Internal\WriteFileContext.cs (1)
172Thread.Sleep(SavingRetryInterval);
System.Data.Common (1)
System\Xml\XmlBoundElement.cs (1)
188Thread.Sleep(0);
System.Data.Odbc (3)
Common\System\Data\ProviderBase\DbConnectionFactory.cs (1)
161Threading.Thread.Sleep(timeBetweenRetriesMilliseconds);
Common\System\Data\ProviderBase\DbConnectionPool.cs (2)
707Thread waitOpenThread = new Thread(WaitForPendingOpen); 934Thread waitOpenThread = new Thread(WaitForPendingOpen);
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\Metrics\AggregationManager.cs (1)
31private Thread? _collectThread;
System\Diagnostics\Metrics\CounterAggregator.cs (1)
37Thread.GetCurrentProcessorId()
System.Drawing.Common.Tests (1)
System\Drawing\ImageAnimator.ManualTests.cs (1)
68Thread.Sleep(60_000);
System.IO.Ports (1)
System\IO\Ports\SerialStream.Unix.cs (1)
946Thread.Sleep(1);
System.Net.Sockets (1)
System\Net\Sockets\SocketAsyncEngine.Unix.cs (1)
203var thread = new Thread(static s => ((SocketAsyncEngine)s!).EventLoop())
System.Private.CoreLib (115)
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (2)
344int index = (int)((uint)Thread.GetCurrentProcessorId() % (uint)SharedArrayPoolStatics.s_partitionCount); // mod by constant in tier 1 364int index = (int)((uint)Thread.GetCurrentProcessorId() % (uint)SharedArrayPoolStatics.s_partitionCount); // mod by constant in tier 1
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ActivityTracker.cs (1)
361int appDomainID = Thread.GetDomainID();
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (1)
270private static Thread? s_pollingThread;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (1)
196Thread.Sleep(10);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
2975Thread.Sleep(15); 4916osThreadId = (long)Thread.CurrentOSThreadId;
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (2)
28Thread currentThread = Thread.CurrentThread;
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (2)
347internal sealed override void ExecuteFromThreadPool(Thread threadPoolThread) => MoveNext(threadPoolThread); 352private void MoveNext(Thread? threadPoolThread)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (1)
359int i = (int)((uint)Thread.GetCurrentProcessorId() % (uint)Environment.ProcessorCount);
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (29)
54ExecutionContext? executionContext = Thread.CurrentThread._executionContext; 79return Thread.CurrentThread._executionContext; 100Thread currentThread = Thread.CurrentThread; 115Thread currentThread = Thread.CurrentThread; 127ExecutionContext? executionContext = Thread.CurrentThread._executionContext; 154Thread currentThread = Thread.CurrentThread; 227Thread currentThread = Thread.CurrentThread; 248internal static void RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, object state) 250Debug.Assert(threadPoolThread == Thread.CurrentThread); 275Thread currentThread = threadPoolThread; 301Thread.CurrentThread._executionContext = executionContext; 312internal static void RestoreChangedContextToThread(Thread currentThread, ExecutionContext? contextToRestore, ExecutionContext? currentContext) 314Debug.Assert(currentThread == Thread.CurrentThread); 329internal static void ResetThreadPoolThread(Thread currentThread) 350Debug.Assert(!Thread.IsThreadStartSupported || Thread.CurrentThread.IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 351Debug.Assert(Thread.CurrentThread._executionContext == null, "ThreadPool thread not on Default ExecutionContext."); 352Debug.Assert(Thread.CurrentThread._synchronizationContext == null, "ThreadPool thread not on Default SynchronizationContext."); 450ExecutionContext? current = Thread.CurrentThread._executionContext; 464ExecutionContext? current = Thread.CurrentThread._executionContext; 528Thread.CurrentThread._executionContext = 552private Thread? _thread; 554internal void Initialize(Thread currentThread) 556Debug.Assert(currentThread == Thread.CurrentThread); 567if (Thread.CurrentThread != _thread)
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLock.cs (5)
30private Thread? _ownerThread; 61bool isLocked = _ownerThread == Thread.CurrentThread; 72Debug.Assert(_ownerThread == Thread.CurrentThread); 82Debug.Assert(_ownerThread != Thread.CurrentThread); 109_ownerThread = Thread.CurrentThread;
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelMonitor.cs (3)
18private Thread? _ownerThread; 28public bool IsLocked => _ownerThread == Thread.CurrentThread; 71_ownerThread = Thread.CurrentThread;
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelSpinWaiter.cs (3)
74int n = Thread.OptimalMaxSpinWaitsPerSpinIteration; 79Thread.SpinWait(n); 85Thread.UninterruptibleSleep0();
src\libraries\System.Private.CoreLib\src\System\Threading\ParameterizedThreadStart.cs (1)
7/// Represents the method that executes on a <see cref="Thread" />.
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Blocking.cs (2)
34if (!BlockingConfig.IsCooperativeBlockingEnabled || !Thread.CurrentThread.IsThreadPoolThread) 71Debug.Assert(Thread.CurrentThread.IsThreadPoolThread);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.GateThread.cs (1)
238Thread gateThread = new Thread(GateThreadStart, SmallStackSizeBytes)
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (1)
186Thread waitThread = new Thread(WaitThreadStart, SmallStackSizeBytes)
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerThread.cs (3)
76Thread workerThread = new Thread(s_workerThreadStart); 165Thread.UninterruptibleSleep0(); 168Thread.SpinWait(1);
src\libraries\System.Private.CoreLib\src\System\Threading\ProcessorIdCache.cs (3)
27int currentProcessorId = Thread.GetCurrentProcessorNumber(); 71if (Thread.GetCurrentProcessorNumber() < 0) 89Thread.GetCurrentProcessorNumber();
src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (4)
1231Thread.SpinWait(LockSpinCycles * spinCount); 1235Thread.Sleep(0); 1569Thread.SpinWait( 1575Thread.Sleep(0);
src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (1)
66Thread.ThrowIfNoThreadStart();
src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (6)
56/// cref="Thread.SpinWait"/> method. 193Thread.Sleep(1); 200Thread.Sleep(0); 204Thread.Yield(); 225int n = Thread.OptimalMaxSpinWaitsPerSpinIteration; 230Thread.SpinWait(n);
src\libraries\System.Private.CoreLib\src\System\Threading\SynchronizationContext.cs (2)
16public static SynchronizationContext? Current => Thread.CurrentThread._synchronizationContext; 55public static void SetSynchronizationContext(SynchronizationContext? syncContext) => Thread.CurrentThread._synchronizationContext = syncContext;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
593if (isDefaultScheduler && taskWasPreviouslyQueued && !Thread.CurrentThread.IsThreadPoolThread)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (3)
2272internal virtual void ExecuteFromThreadPool(Thread threadPoolThread) => ExecuteEntryUnsafe(threadPoolThread); 2274internal void ExecuteEntryUnsafe(Thread? threadPoolThread) // used instead of ExecuteEntry() when we don't have to worry about double-execution prevent 2302private void ExecuteWithThreadLocal(ref Task? currentTaskSlot, Thread? threadPoolThread = null)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (1)
489(TaskScheduler.InternalCurrent == m_scheduler || Thread.CurrentThread.IsThreadPoolThread);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (1)
45if (Thread.IsThreadStartSupported && (options & TaskCreationOptions.LongRunning) != 0)
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (3)
22private static Thread? t_currentThread; 356public static Thread CurrentThread 636/// Manages functionality required to support members of <see cref="Thread"/> dealing with thread-local data
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.Unix.cs (1)
39internal static void UninterruptibleSleep0() => Thread.Yield();
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadAbortException.cs (1)
10/// The exception that is thrown when a call is made to the <see cref="Thread.Abort" /> method.
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPool.Unix.cs (1)
88Thread.ThrowIfNoThreadStart();
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolCallbackWrapper.cs (3)
8private Thread _currentThread; 12Thread currentThread = Thread.CurrentThread;
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (6)
1062Thread currentThread = tl.currentThread; 1198private static void DispatchWorkItemWithWorkerTracking(object workItem, Thread currentThread) 1201Debug.Assert(currentThread == Thread.CurrentThread); 1218private static void DispatchWorkItem(object workItem, Thread currentThread) 1252public readonly Thread currentThread; 1262currentThread = Thread.CurrentThread;
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadStart.cs (1)
7/// Represents the method that executes on a <see cref="Thread" />.
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadStateException.cs (2)
11/// The exception that is thrown when a <see cref="Thread" /> is in an invalid <see cref="Thread.ThreadState" /> for the method call.
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (2)
514_associatedTimerQueue = TimerQueue.Instances[(uint)Thread.GetCurrentProcessorId() % TimerQueue.Instances.Length]; 729ExecutionContext.RunFromThreadPoolDispatchLoop(Thread.CurrentThread, context, s_callCallbackInContext, this);
src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (1)
38Thread timerThread = new Thread(TimerThread)
src\System\GC.CoreCLR.cs (2)
313Thread currentThread = Thread.CurrentThread;
src\System\Runtime\CompilerServices\StaticsHelpers.cs (1)
177ThreadLocalData *t_ThreadStatics = System.Threading.Thread.GetThreadStaticsBase();
src\System\Runtime\ControlledExecution.CoreCLR.cs (3)
55Canceler canceler = new(Thread.CurrentThread); 130private readonly Thread _thread; 133public Canceler(Thread thread)
src\System\Threading\Thread.CoreCLR.cs (6)
155private static Thread InitializeCurrentThread() 157Thread? thread = null; 167Thread _this = this; 274Thread _this = this; 419Thread _this = this; 502NativeThreadState catchAtSafePoint = ((NativeThreadClass*)Thread.DirectOnThreadLocalData.pNativeThread)->m_State & NativeThreadState.TS_CatchAtSafePoint;
System.Private.Windows.Core (4)
System\Private\Windows\Ole\ClipboardCore.cs (4)
42Thread.Sleep(millisecondsTimeout: OleRetryDelay); 78Thread.Sleep(millisecondsTimeout: OleRetryDelay); 91Thread.Sleep(millisecondsTimeout: retryDelay); 121Thread.Sleep(millisecondsTimeout: OleRetryDelay);
System.Private.Windows.Core.TestUtilities (10)
XUnit\UseCultureAttribute.cs (9)
15/// Apply this attribute to your test method to replace the <see cref="Thread.CurrentThread" /> 67/// Stores the current <see cref="Thread.CurrentPrincipal" /> 74_originalCulture = Thread.CurrentThread.CurrentCulture; 75_originalUICulture = Thread.CurrentThread.CurrentUICulture; 78Thread.CurrentThread.CurrentCulture = Culture; 79Thread.CurrentThread.CurrentUICulture = UICulture; 93/// <see cref="CultureInfo.CurrentUICulture" /> to <see cref="Thread.CurrentPrincipal" /> 98Thread.CurrentThread.CurrentCulture = _originalCulture; 99Thread.CurrentThread.CurrentUICulture = _originalUICulture;
XUnit\UseDefaultXunitCultureAttribute.cs (1)
9/// Apply this attribute to your test method to replace the <see cref="Thread.CurrentThread" />
System.Private.Xml.Linq (2)
System\Xml\Linq\XHashtable.cs (2)
113Thread.MemoryBarrier(); 295Thread.MemoryBarrier();
System.Runtime.Caching (3)
System\Runtime\Caching\CacheExpires.cs (1)
881Thread.Sleep(100);
System\Runtime\Caching\MemoryCacheStatistics.cs (2)
350Thread.Sleep(100); 387Thread.Sleep(100);
System.Runtime.InteropServices (1)
System\Runtime\InteropServices\HandleCollector.cs (1)
81Thread.Sleep(10 * collectionGeneration);
System.Security.Claims (1)
System\Security\Claims\ClaimsPrincipal.cs (1)
41IPrincipal? threadPrincipal = Thread.CurrentPrincipal;
System.Security.Permissions (1)
System\Security\Permissions\PrincipalPermission.cs (1)
226IPrincipal principal = Thread.CurrentPrincipal;
System.Threading (10)
System\Threading\ReaderWriterLock.cs (10)
155Thread.Sleep(sleepDurationMilliseconds); 171Thread.Sleep(1); 325Thread.Sleep(1000); 341Thread.Sleep(1); 491Thread.Sleep(100); 516Thread.Sleep(100); 611Thread.Sleep(100); 625Thread.Sleep(100); 801Thread.Sleep(100); 1012Thread.SpinWait(1);
System.Threading.Tasks.Dataflow (1)
Internal\Common.cs (1)
76if (!Thread.Yield())
System.Threading.Thread (1)
artifacts\obj\System.Threading.Thread\Debug\net10.0\System.Threading.Thread.Forwards.cs (1)
7[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Thread))]
System.Transactions.Local (8)
System\Transactions\TransactionScope.cs (6)
521if ((_scopeThread != Thread.CurrentThread) && !AsyncFlowEnabled) 907_scopeThread = Thread.CurrentThread; 973if (_scopeThread == Thread.CurrentThread) 990if (_savedCurrentScope._scopeThread != Thread.CurrentThread) 1011if (_scopeThread != Thread.CurrentThread) 1206private Thread? _scopeThread;
System\Transactions\TransactionTable.cs (2)
89Thread.Sleep(0); 95Thread.Sleep(SLEEP_TIME);
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\NativeMethods.cs (1)
548System.Threading.Thread.Sleep(sleep);
System.Windows.Forms (23)
System\Windows\Forms\Application.ComponentThreadContext.cs (1)
404_idleHandler?.Invoke(Thread.CurrentThread, EventArgs.Empty);
System\Windows\Forms\Application.cs (4)
226get => Thread.CurrentThread.CurrentCulture; 227set => Thread.CurrentThread.CurrentCulture = value; 342Thread.Yield(); 1252=> ThreadContext.FromCurrent()._idleHandler?.Invoke(Thread.CurrentThread, e);
System\Windows\Forms\Application.LightThreadContext.cs (1)
121_idleHandler?.Invoke(Thread.CurrentThread, EventArgs.Empty);
System\Windows\Forms\Application.ThreadContext.cs (3)
243_enterModalHandler(Thread.CurrentThread, EventArgs.Empty); 433_leaveModalHandler(Thread.CurrentThread, EventArgs.Empty); 606_threadExceptionHandler(Thread.CurrentThread, new ThreadExceptionEventArgs(ex));
System\Windows\Forms\Control.cs (1)
11776Thread.Sleep(50);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarButtonAccessibleObject.cs (1)
78Thread.Sleep(50);
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (2)
396Thread.MemoryBarrier(); 432Thread.MemoryBarrier();
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.Vista.cs (2)
134Thread.MemoryBarrier(); 164Thread.MemoryBarrier();
System\Windows\Forms\Printing\PrintControllerWithStatusDialog.BackgroundThread.cs (1)
12private readonly Thread _thread;
System\Windows\Forms\SendKeys\SendKeys.cs (1)
719Thread.Sleep(1);
System\Windows\Forms\WindowsFormsSynchronizationContext.cs (6)
14private WeakReference<Thread>? _destinationThread; 29DestinationThread = Thread.CurrentThread; 34private WindowsFormsSynchronizationContext(Control? marshalingControl, Thread? destinationThread) 44private Thread? DestinationThread 46get => _destinationThread?.TryGetTarget(out Thread? target) == true ? target : null; 80Thread? destinationThread = DestinationThread;
System.Windows.Forms.Analyzers.CSharp.Tests (2)
Generators\ApplicationConfigurationInitializeBuilderTests.cs (1)
153Thread.CurrentThread.CurrentCulture = culture;
Generators\ProjectFileReaderTests.FontConverter.cs (1)
66Thread.CurrentThread.CurrentCulture = culture;
System.Windows.Forms.Analyzers.Tests (1)
System\Windows\Forms\Analyzers\ApplicationConfigTests.FontDescriptor.cs (1)
70Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureName);
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\MaskDescriptor.cs (1)
41public virtual CultureInfo Culture => Thread.CurrentThread.CurrentCulture;
System.Windows.Forms.Design.Tests (7)
System\Windows\Forms\Design\MaskDescriptorTests.cs (7)
16_originalCulture = Thread.CurrentThread.CurrentCulture; 21Thread.CurrentThread.CurrentCulture = _originalCulture; 64Thread.CurrentThread.CurrentCulture = newCulture; 133Thread.CurrentThread.CurrentCulture = new(culture1); 138Thread.CurrentThread.CurrentCulture = _originalCulture; 142Thread.CurrentThread.CurrentCulture = new(culture2); 158Thread.CurrentThread.CurrentCulture = _originalCulture;
System.Windows.Forms.IntegrationTests.Common (5)
TestHelpers.cs (5)
394public static void SetCulture(this Thread thread, string culture) 400Thread.CurrentThread.CurrentCulture = cultureInfo; 401Thread.CurrentThread.CurrentUICulture = cultureInfo; 418/// <seealso cref="Thread.Sleep(int)"/> 458Thread.Sleep(200);
System.Windows.Forms.Tests (31)
System\Windows\Forms\ApplicationTests.cs (3)
18Assert.Same(Thread.CurrentThread.CurrentCulture, Application.CurrentCulture); 50Assert.Same(value, Thread.CurrentThread.CurrentCulture); 57Assert.Same(value, Thread.CurrentThread.CurrentCulture);
System\Windows\Forms\ControlTests.ControlCollection.cs (2)
1124Thread thread = new(() => 1148Thread thread = new(() =>
System\Windows\Forms\CursorConverterTests.cs (1)
192Thread.MemoryBarrier();
System\Windows\Forms\FontCacheTests.cs (2)
25Thread.Sleep(random.Next(5)); 33Thread.Sleep(random.Next(10));
System\Windows\Forms\KeysConverterTests.cs (13)
40CultureInfo originalUICulture = Thread.CurrentThread.CurrentUICulture; 44Thread.CurrentThread.CurrentUICulture = culture; 52Thread.CurrentThread.CurrentUICulture = originalUICulture; 104CultureInfo originalUICulture = Thread.CurrentThread.CurrentUICulture; 107Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(cultureName); 110object resultWithUICulture = converter.ConvertTo(context: null, culture: Thread.CurrentThread.CurrentUICulture, keys, typeof(Enum[])); 117Thread.CurrentThread.CurrentUICulture = originalUICulture; 137CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture; 138CultureInfo originalUICulture = Thread.CurrentThread.CurrentUICulture; 141Thread.CurrentThread.CurrentCulture = cultureName is not null ? CultureInfo.GetCultureInfo(cultureName) : originalCulture; 142Thread.CurrentThread.CurrentUICulture = uiCultureName is not null ? CultureInfo.GetCultureInfo(uiCultureName) : originalUICulture; 166Thread.CurrentThread.CurrentCulture = originalCulture; 167Thread.CurrentThread.CurrentUICulture = originalUICulture;
System\Windows\Forms\ScreenDcCacheTests.cs (2)
16Thread.Sleep(random.Next(5)); 21Thread.Sleep(random.Next(5));
System\Windows\Forms\TabControlTests.cs (1)
5727Thread.Sleep(100);
System\Windows\Forms\ToolStripMenuItemTests.cs (6)
152CultureInfo uiCulture = Thread.CurrentThread.CurrentUICulture; 153CultureInfo curCulture = Thread.CurrentThread.CurrentCulture; 155Thread.CurrentThread.CurrentUICulture = threadUICulture; 156Thread.CurrentThread.CurrentCulture = threadCulture; 161Thread.CurrentThread.CurrentUICulture = uiCulture; 162Thread.CurrentThread.CurrentCulture = curCulture;
System\Windows\Forms\WindowsFormsSynchronizationContextTests.cs (1)
81Thread thread = new(() =>
System.Windows.Forms.UI.IntegrationTests (7)
DragDropTests.cs (1)
618Thread.Sleep(DragDropDelayMS);
Infra\ControlTestBase.cs (1)
71if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA)
Infra\DenyExecutionSynchronizationContext.cs (3)
12private readonly Thread _mainThread; 20private DenyExecutionSynchronizationContext(SynchronizationContext underlyingContext, Thread? mainThread, StrongBox<ExceptionDispatchInfo>? failedTransfer) 29internal Thread MainThread => _mainThread;
Input\KeyboardSimulator.cs (1)
117Thread.Sleep(time);
Input\MouseSimulator.cs (1)
173Thread.Sleep(time);
System.Xaml (1)
System\Xaml\XamlBackgroundReader.cs (1)
36Thread _thread;
Templates.Blazor.Tests (1)
src\ProjectTemplates\Shared\Project.cs (1)
448Thread.Sleep(3000);
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\ProjectTemplates\Shared\Project.cs (1)
448Thread.Sleep(3000);
Templates.Blazor.WebAssembly.Tests (1)
src\ProjectTemplates\Shared\Project.cs (1)
448Thread.Sleep(3000);
Templates.Mvc.Tests (1)
src\ProjectTemplates\Shared\Project.cs (1)
448Thread.Sleep(3000);
Templates.Tests (1)
src\ProjectTemplates\Shared\Project.cs (1)
448Thread.Sleep(3000);
UIAutomationClient (3)
MS\Internal\Automation\HwndProxyElementProvider.cs (2)
477Thread.Sleep( 100 ); 1621System.Threading.Thread.Sleep(1);
MS\Internal\Automation\QueueProcessor.cs (1)
187Thread _thread; // the thread on which QueueItem's are processed
UIAutomationClientSideProviders (14)
MS\Internal\AutomationProxies\Misc.cs (2)
112System.Threading.Thread.Sleep(1); 970System.Threading.Thread.Sleep(50);
MS\Internal\AutomationProxies\QueueProcessor.cs (1)
59Thread thread = new Thread(threadStart)
MS\Internal\AutomationProxies\WindowsButton.cs (1)
510System.Threading.Thread.Sleep(1);
MS\Internal\AutomationProxies\WindowsListViewItem.cs (1)
795System.Threading.Thread.Sleep(1);
MS\Internal\AutomationProxies\WindowsMenu.cs (8)
1449System.Threading.Thread.Sleep(1); 1497System.Threading.Thread.Sleep(100); 1511System.Threading.Thread.Sleep(1); 1517System.Threading.Thread.Sleep(100); 2167System.Threading.Thread.Sleep(10); 2270System.Threading.Thread.Sleep(1); 2323System.Threading.Thread.Sleep(1); 2336System.Threading.Thread.Sleep(1);
MS\Internal\AutomationProxies\WindowsTreeView.cs (1)
624System.Threading.Thread.Sleep(1);
UIAutomationTypes (1)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\HandleCollector.cs (1)
130System.Threading.Thread.Sleep(sleep);
vbc (3)
src\Compilers\Shared\BuildClient.cs (1)
187var thread = new Thread(action);
src\Compilers\Shared\BuildServerConnection.cs (2)
689Thread.Sleep(1); 780Thread.Sleep(1);
VBCSCompiler (3)
src\Compilers\Shared\BuildClient.cs (1)
187var thread = new Thread(action);
src\Compilers\Shared\BuildServerConnection.cs (2)
689Thread.Sleep(1); 780Thread.Sleep(1);
VBCSCompiler.UnitTests (3)
CompilerServerApiTest.cs (1)
75var thread = new Thread(_ =>
VBCSCompilerServerTests.cs (2)
102var thread = new Thread(() => 152var thread = new Thread(() =>
WindowsBase.Tests (12)
Helpers.cs (2)
19var t = new Thread(() => 44var t = new Thread(() =>
System\Windows\Data\DataSourceProviderTests.cs (2)
1380var thread = new Thread(() => 1828var thread = new Thread(() =>
System\Windows\Threading\DispatcherObjectTests.cs (2)
31var thread = new Thread(() => 72var thread = new Thread(() =>
System\Windows\Threading\DispatcherTests.cs (6)
21Assert.Same(Thread.CurrentThread, dispatcher.Thread); 33Dispatcher dispatcher = Dispatcher.FromThread(Thread.CurrentThread); 40Assert.Same(Thread.CurrentThread, dispatcher.Thread); 46var thread = new Thread(() => { }); 162var thread = new Thread(() => 183var thread = new Thread(() =>
WinFormsControlsTest (5)
MultipleControls.cs (1)
115Thread.Sleep(100);
Program.cs (4)
8Thread.CurrentThread.SetApartmentState(ApartmentState.Unknown); 9Thread.CurrentThread.SetApartmentState(ApartmentState.STA); 13Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;