68 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\roslyn\src\Compilers\Shared\BuildClient.cs (1)
184var thread = new Thread(action);
dotnet (1)
Commands\Test\MTP\Terminal\TestProgressStateAwareTerminal.cs (1)
92_refresher = new Thread(ThreadProc) { IsBackground = true };
ILCompiler.ReadyToRun (1)
Compiler\ReadyToRunCodegenCompilation.cs (1)
859new Thread(CompilationThread).Start((object)compilationThreadId);
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Infrastructure\Heartbeat.cs (1)
30_timerThread = new Thread(state => ((Heartbeat)state!).TimerLoop())
Microsoft.Build (9)
BackEnd\Client\MSBuildClientPacketPump.cs (1)
170_packetPumpThread = new Thread(PacketPumpProc)
BackEnd\Components\Communications\NodeEndpointInProc.cs (1)
368_packetPump = new Thread(() =>
BackEnd\Components\Communications\NodeProviderInProc.cs (1)
364nodeContext._inProcNodeThread = new Thread(() =>
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
1061_drainPacketQueueThread = new Thread(DrainPacketQueue, 0x30000);
BackEnd\Components\Logging\LoggingService.cs (1)
1418_loggingEventProcessingThread = new Thread(LoggingEventProc);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
1583var thread = new Thread(() =>
Logging\TerminalLogger\TerminalLogger.cs (1)
577_refresher = new Thread(ThreadProc);
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (1)
347_packetPump = new Thread(PacketPumpProc);
Utilities\AwaitExtensions.cs (1)
184Thread thread = new Thread(threadStart);
Microsoft.Build.Tasks.Core (1)
Copy.cs (1)
66Thread newThread = new Thread(ParallelCopyTask);
Microsoft.DotNet.HotReload.Watch (1)
FileWatcher\PollingDirectoryWatcher.cs (1)
32_pollingThread = new Thread(new ThreadStart(PollingLoop))
Microsoft.Extensions.Hosting.WindowsServices (1)
WindowsServiceLifetime.cs (1)
92Thread thread = new Thread(Run);
Microsoft.Extensions.Logging.Console (1)
ConsoleLoggerProcessor.cs (1)
71_outputThread = new Thread(ProcessLogQueue)
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.TemplateEngine.Edge (1)
Settings\AsyncMutex.cs (1)
25new Thread(WaitLoop).Start();
Microsoft.TestPlatform.PlatformAbstractions (1)
netcore\System\PlatformThread.cs (1)
30var thread = new Thread(() =>
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\Interaction.vb (1)
223Dim thread As New Thread(New ThreadStart(AddressOf inputHandler.StartHere))
Microsoft.Win32.SystemEvents (1)
Microsoft\Win32\SystemEvents.cs (1)
480s_windowThread = new Thread(new ThreadStart(systemEvents.WindowThreadProc))
MSBuild (2)
OutOfProcTaskHostNode.cs (1)
1182var taskThread = new Thread(new ParameterizedThreadStart(RunTask));
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (1)
347_packetPump = new Thread(PacketPumpProc);
PresentationCore (3)
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (1)
293Thread inkingThread = new Thread(new ThreadStart(InkingThreadProc));
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (1)
481Thread thread = new Thread(new ThreadStart(ThreadProc))
System\Windows\Media\Imaging\BitmapDownload.cs (1)
59_thread = new Thread(new ThreadStart(DownloadThreadProc));
PresentationUI (1)
MS\Internal\Documents\SigningProgress.cs (1)
51Thread 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.Data.OleDb (2)
System\Data\ProviderBase\DbConnectionPool.cs (2)
1075Thread waitOpenThread = new Thread(WaitForPendingOpen); 1408Thread waitOpenThread = new Thread(WaitForPendingOpen);
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Metrics\AggregationManager.cs (1)
193_collectThread = new Thread(CollectWorker);
System.DirectoryServices.Protocols (1)
System\DirectoryServices\Protocols\ldap\LdapPartialResultsProcessor.cs (1)
347var thread = new Thread(new ThreadStart(ThreadRoutine))
System.Drawing.Common (1)
System\Drawing\ImageAnimator.cs (1)
259s_animationThread = new Thread(new ThreadStart(AnimateImages))
System.IO.FileSystem.Watcher (1)
System\IO\FileSystemWatcher.Linux.cs (1)
188Thread thread = new Thread(obj => ((INotify)obj!).ProcessEvents())
System.Management (5)
System\Management\InteropClasses\WMIInterop.cs (5)
1208Thread thread = new Thread(new ThreadStart(WorkerThread)); 1604this.thread = new Thread(new ThreadStart(ThreadEntryPointMethodWithReturn)); 1620this.thread = new Thread(new ThreadStart(ThreadEntryPointMethodWithReturnAndParam)); 1636this.thread = new Thread(new ThreadStart(ThreadEntryPoint)); 1652this.thread = new Thread(new ThreadStart(ThreadEntryPointMethodWithParam));
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)
198var thread = new Thread(static s => ((SocketAsyncEngine)s!).EventLoop())
System.Private.CoreLib (8)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (1)
174s_pollingThread = new Thread(PollForValues)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (1)
107new Thread(HandleSignal)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.GateThread.cs (1)
263Thread gateThread = new Thread(GateThreadStart, SmallStackSizeBytes)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (1)
186Thread waitThread = new Thread(WaitThreadStart, SmallStackSizeBytes)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerThread.cs (1)
59Thread workerThread = new Thread(s_workerThreadStart);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (1)
49new Thread(s_longRunningThreadWork)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (1)
38Thread timerThread = new Thread(TimerThread)
System\Threading\Thread.NativeAot.cs (1)
91var currentThread = new Thread();
System.ServiceModel.Primitives (1)
Internals\System\Runtime\IOThreadScheduler.cs (1)
537var thread = new Thread(new ThreadStart(Callback));
System.Speech (2)
Internal\SapiInterop\SapiProxy.cs (1)
116_mta = new Thread(new ThreadStart(SapiMTAThread));
Internal\Synthesis\VoiceSynthesis.cs (1)
76_workerThread = new Thread(new ThreadStart(ThreadProc))
System.Windows.Forms (1)
System\Windows\Forms\Printing\PrintControllerWithStatusDialog.BackgroundThread.cs (1)
24_thread = new Thread(new ThreadStart(Run));
System.Xaml (1)
System\Xaml\XamlBackgroundReader.cs (1)
91_thread = new Thread(start)
UIAutomationClient (1)
MS\Internal\Automation\QueueProcessor.cs (1)
66_thread = new Thread(threadStart)
UIAutomationClientSideProviders (1)
MS\Internal\AutomationProxies\QueueProcessor.cs (1)
58Thread thread = new Thread(threadStart)
vbc (1)
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
184var thread = new Thread(action);
VBCSCompiler (1)
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
184var thread = new Thread(action);
707 references to Thread
aspire (2)
Commands\RenderCommand.cs (1)
168() => Thread.Sleep(TimeSpan.FromSeconds(1)),
Commands\RootCommand.cs (1)
166Thread.Sleep(1000);
Aspire.Dashboard.Components.Tests (9)
UseCultureAttribute.cs (9)
11/// <see cref="Thread.CurrentThread" /> <see cref="CultureInfo.CurrentCulture" /> and 60/// 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" /> 86Thread.CurrentThread.CurrentCulture = _originalCulture!; 87Thread.CurrentThread.CurrentUICulture = _originalUICulture!;
Aspire.Hosting (1)
DistributedApplication.cs (1)
272Thread.Sleep(1000);
Aspire.Hosting.Testing (1)
DistributedApplicationEntryPointInvoker.cs (1)
78var thread = new Thread(() =>
Aspire.Hosting.Tests (13)
Utils\DockerUtils.cs (1)
16Thread.Sleep(1000);
Utils\UseCultureAttributeTests.cs (12)
71var originalCulture = Thread.CurrentThread.CurrentCulture; 76Assert.Equal(attr.Culture, Thread.CurrentThread.CurrentCulture); 80Assert.Equal(originalCulture, Thread.CurrentThread.CurrentCulture); 89var originalUICulture = Thread.CurrentThread.CurrentUICulture; 94Assert.Equal(attr.UICulture, Thread.CurrentThread.CurrentUICulture); 98Assert.Equal(originalUICulture, Thread.CurrentThread.CurrentUICulture); 104Assert.Equal("sv-SE", Thread.CurrentThread.CurrentCulture.Name); 110Assert.Equal("es-CL", Thread.CurrentThread.CurrentUICulture.Name); 119var originalCulture = Thread.CurrentThread.CurrentCulture; 124var ri = new RegionInfo(Thread.CurrentThread.CurrentCulture.LCID); 126Assert.Equal(attr.Culture, Thread.CurrentThread.CurrentCulture); 131Assert.Equal(originalCulture, Thread.CurrentThread.CurrentCulture);
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (1)
35private readonly Thread drainThread;
Aspire.TestUtilities (10)
UseCultureAttribute.cs (9)
14/// <see cref="Thread.CurrentThread" /> <see cref="CultureInfo.CurrentCulture" /> and 57/// Stores the current <see cref="Thread.CurrentPrincipal" /> 64_originalCulture = Thread.CurrentThread.CurrentCulture; 65_originalUICulture = Thread.CurrentThread.CurrentUICulture; 70Thread.CurrentThread.CurrentCulture = Culture; 71Thread.CurrentThread.CurrentUICulture = UICulture; 81/// <see cref="CultureInfo.CurrentUICulture" /> to <see cref="Thread.CurrentPrincipal" /> 88Thread.CurrentThread.CurrentCulture = _originalCulture; 93Thread.CurrentThread.CurrentUICulture = _originalUICulture;
UseDefaultXunitCultureAttribute.cs (1)
9/// Apply this attribute to your test method to replace the <see cref="Thread.CurrentThread" />
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\roslyn\src\Compilers\Shared\BuildClient.cs (1)
184var thread = new Thread(action);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
819Thread.Sleep(1); 910Thread.Sleep(1);
dotnet (3)
Commands\Test\MTP\Terminal\TestProgressStateAwareTerminal.cs (1)
28private Thread? _refresher;
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.9.0-1.26307.102\contentFiles\cs\net11.0\BuildServerConnection.cs (2)
819Thread.Sleep(1); 910Thread.Sleep(1);
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
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
150Thread.Sleep(10);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
ILCompiler.RyuJit (4)
Compiler\RyuJitCompilation.cs (4)
25private readonly ConditionalWeakTable<Thread, CorInfoImpl> _corinfos = new ConditionalWeakTable<Thread, CorInfoImpl>(); 175CorInfoImpl corInfo = _corinfos.GetValue(Thread.CurrentThread, thread => new CorInfoImpl(this)); 190CorInfoImpl corInfo = _corinfos.GetValue(Thread.CurrentThread, thread => new CorInfoImpl(this));
Microsoft.Analyzers.Extra.Tests (1)
CallAnalysis\StaticTimeTests.cs (1)
17Assembly.GetAssembly(typeof(Thread))!,
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\DefaultKeyResolver.cs (1)
144Thread.Sleep(_decryptRetryDelay);
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
FormatWeekHelper.cs (1)
21var calendar = Thread.CurrentThread.CurrentCulture.Calendar;
Microsoft.AspNetCore.Razor.Utilities.Shared (1)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
150Thread.Sleep(10);
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Infrastructure\Heartbeat.cs (1)
18private readonly Thread _timerThread;
Microsoft.Build (20)
BackEnd\Client\MSBuildClient.cs (1)
289Thread.Sleep(100);
BackEnd\Client\MSBuildClientPacketPump.cs (1)
58private Thread? _packetPumpThread;
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
1500file.WriteLine("{0}({1})-{2}: {3}", Thread.CurrentThread.Name, Environment.CurrentManagedThreadId, DateTime.UtcNow.Ticks, message);
BackEnd\Components\Communications\NodeEndpointInProc.cs (1)
78private Thread _packetPump;
BackEnd\Components\Communications\NodeProviderInProc.cs (1)
50public Thread _inProcNodeThread;
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
997private readonly Thread _drainPacketQueueThread;
BackEnd\Components\Logging\LoggingService.cs (2)
281private Thread _loggingEventProcessingThread; 1494var pumpTask = _loggingEventProcessingThread;
BackEnd\Components\RequestBuilder\RequestBuilder.cs (5)
726Thread.CurrentThread.Priority = _componentHost.BuildParameters.BuildThreadPriority; 727Thread.CurrentThread.IsBackground = true; 739if (string.IsNullOrEmpty(Thread.CurrentThread.Name)) 741Thread.CurrentThread.Name = threadName; 1583var thread = new Thread(() =>
BackEnd\Components\Scheduler\Scheduler.cs (1)
2684file.Write("{0}({1})-{2}: ", Thread.CurrentThread.Name, Environment.CurrentManagedThreadId, _schedulingData.EventTime.Ticks);
BackEnd\Node\OutOfProcServerNode.cs (2)
394Thread.CurrentThread.CurrentCulture = command.Culture; 395Thread.CurrentThread.CurrentUICulture = command.UICulture;
Logging\TerminalLogger\TerminalLogger.cs (1)
162private Thread? _refresher;
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (2)
90private Thread _packetPump; 315Assumed.NotEqual(_packetPump.ManagedThreadId, Thread.CurrentThread.ManagedThreadId, "Can't join on the same thread.");
Utilities\AwaitExtensions.cs (1)
184Thread thread = new Thread(threadStart);
Microsoft.Build.Framework (9)
BackEnd\CommunicationsUtilities.cs (1)
775writer.WriteLine($"{Thread.CurrentThread.Name} (TID {Environment.CurrentManagedThreadId}) {now,15} +{millisecondsSinceLastLog,10}ms: {message}");
BuildEventArgs.cs (1)
90threadId = System.Threading.Thread.CurrentThread.GetHashCode();
FileUtilities.cs (2)
1150Thread.Sleep(retryTimeOut); 1188Thread.Sleep(10);
Telemetry\CrashTelemetry.cs (1)
411CrashThreadName = System.Threading.Thread.CurrentThread.Name;
Utilities\ThreadPoolExtensions.cs (4)
32Thread.CurrentThread.CurrentCulture = culture; 37Thread.CurrentThread.CurrentUICulture = uiCulture; 47Thread.CurrentThread.CurrentCulture = originalThreadCulture; 52Thread.CurrentThread.CurrentUICulture = originalThreadUICulture;
Microsoft.Build.Tasks.CodeAnalysis (2)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
819Thread.Sleep(1); 910Thread.Sleep(1);
Microsoft.Build.Tasks.Core (9)
BootstrapperUtil\Util.cs (1)
81public static CultureInfo DefaultCultureInfo => System.Threading.Thread.CurrentThread.CurrentUICulture;
Copy.cs (5)
48private static Thread[] copyThreads; 61copyThreads = new Thread[DefaultCopyParallelism]; 66Thread newThread = new Thread(ParallelCopyTask); 1092Thread.Sleep(RetryDelayMilliseconds); 1118Thread.Sleep(RetryDelayMilliseconds);
Delete.cs (1)
161Thread.Sleep(RetryDelayMilliseconds);
FileIO\WriteLinesToFile.cs (1)
233System.Threading.Thread.Sleep(10);
ManifestUtil\SecurityUtil.cs (1)
799System.Threading.Thread.Sleep(50);
Microsoft.Build.Utilities.Core (1)
ToolTask.cs (1)
1157Thread.Sleep(50);
Microsoft.CodeAnalysis (1)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
150Thread.Sleep(10);
Microsoft.CodeAnalysis.Analyzers (2)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
150Thread.Sleep(10);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
150Thread.Sleep(10);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.CodeStyle (2)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
150Thread.Sleep(10);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.CSharp (1)
CommandLine\CSharpCommandLineParser.cs (1)
301Thread.Sleep(100);
Microsoft.CodeAnalysis.Extensions.Package (1)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
150Thread.Sleep(10);
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
150Thread.Sleep(10);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Microsoft.CodeAnalysis.VisualBasic (1)
CommandLine\VisualBasicCommandLineParser.vb (1)
464Thread.Sleep(100)
Microsoft.CodeAnalysis.Workspaces (3)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
150Thread.Sleep(10);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
Workspace\Solution\TextLoader.cs (1)
154Thread.Sleep(RetryDelay);
Microsoft.Data.Analysis.Tests (1)
test\Microsoft.ML.TestFramework\BaseTestClass.cs (1)
47Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Microsoft.DotNet.Build.Tasks.Packaging (1)
NuGetUtility.cs (1)
54Thread.Sleep(5000);
Microsoft.DotNet.Cli.Utils (1)
FileAccessRetrier.cs (1)
70Thread.Sleep(nextWaitTime);
Microsoft.DotNet.HotReload.Watch (2)
FileWatcher\PollingDirectoryWatcher.cs (2)
22private readonly Thread _pollingThread; 71Thread.Sleep(_minRunInternal);
Microsoft.DotNet.XliffTasks (1)
ExponentialRetry.cs (1)
31Thread.Sleep(t);
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 (2)
Windows\Tcp6TableInfoTests.cs (1)
306Thread.Sleep(6000);
Windows\TcpTableInfoTests.cs (1)
248Thread.Sleep(6000);
Microsoft.Extensions.Diagnostics.Testing.Tests (4)
Logging\FakeLoggerTests.cs (3)
119var oldCulture = Thread.CurrentThread.CurrentCulture; 120Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("fr-CA"); 140Thread.CurrentThread.CurrentCulture = oldCulture;
Metrics\MetricCollectorTests.cs (1)
371Thread.Sleep(2000);
Microsoft.Extensions.DotNetDeltaApplier (1)
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\StartupHook.cs (1)
81Thread.Sleep(Timeout.Infinite);
Microsoft.Extensions.Hosting (1)
Internal\ConsoleLifetime.netcoreapp.cs (1)
47Thread.Sleep(HostOptions.ShutdownTimeout);
Microsoft.Extensions.Hosting.WindowsServices (1)
WindowsServiceLifetime.cs (1)
92Thread 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.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)
861var oldCulture = Thread.CurrentThread.CurrentCulture; 862Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("fr-CA"); 868Thread.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)
233 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)
779var currentCulture = Thread.CurrentThread.CurrentCulture; 780Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE"); 788Thread.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.NET.Build.Tasks (1)
CreateAppHost.cs (1)
134Thread.Sleep(RetryDelayMilliseconds);
Microsoft.NET.HostModel (1)
AppHost\RetryUtil.cs (1)
34Thread.Sleep(NumMilliSecondsToWait);
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (1)
GZipCompress.cs (1)
81Thread.Sleep(RetryDelayMs * attempt);
Microsoft.NET.Sdk.Razor.Tasks (1)
DotnetToolTask.cs (1)
93Thread.Sleep(TimeSpan.FromSeconds(3));
Microsoft.Private.Windows.Core (5)
System\Private\Windows\Ole\ClipboardCore.cs (5)
61Thread.Sleep(millisecondsTimeout: retryDelay); 95Thread.Sleep(millisecondsTimeout: retryDelay); 139Thread.Sleep(millisecondsTimeout: retryDelay); 156Thread.Sleep(millisecondsTimeout: retryDelay); 199Thread.Sleep(millisecondsTimeout: retryDelay);
Microsoft.TestPlatform.Build (1)
Tasks\VSTestTask.cs (1)
61Thread.Sleep(1000);
Microsoft.TestPlatform.CoreUtilities (1)
Utilities\JobQueue.cs (1)
294Thread.CurrentThread.Name = threadName;
Microsoft.TestPlatform.Extensions.BlameDataCollector (1)
ProcDumpDumper.cs (1)
187Thread.Sleep(500);
Microsoft.TestPlatform.PlatformAbstractions (1)
netcore\System\PlatformThread.cs (1)
30var thread = new Thread(() =>
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)
157Thread.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.Win32.SystemEvents (2)
Microsoft\Win32\SystemEvents.cs (2)
27private static volatile Thread? s_windowThread; 387throw new ArgumentException(SR.Format(SR.InvalidLowBoundArgument, nameof(interval), interval.ToString(System.Threading.Thread.CurrentThread.CurrentCulture), "0"));
MSBuild (9)
OutOfProcTaskHostNode.cs (3)
1182var taskThread = new Thread(new ParameterizedThreadStart(RunTask)); 1434Thread.CurrentThread.CurrentCulture = taskConfiguration.Culture; 1435Thread.CurrentThread.CurrentUICulture = taskConfiguration.UICulture;
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (2)
90private Thread _packetPump; 315Assumed.NotEqual(_packetPump.ManagedThreadId, Thread.CurrentThread.ManagedThreadId, "Can't join on the same thread.");
TaskExecutionContext.cs (1)
40public Thread? ExecutingThread { get; set; }
XMake.cs (3)
1942Thread thisThread = Thread.CurrentThread; 2086Thread.Sleep(100);
mscorlib (1)
src\runtime\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))]
NuGet.Common (4)
ConcurrencyUtilities.cs (2)
183Thread.Sleep(SleepDuration); 192Thread.Sleep(SleepDuration);
LocalResourceUtils.cs (1)
84Thread.Sleep(500);
PathUtil\FileUtility.cs (1)
283Thread.Sleep(ms);
NuGet.PackageManagement (5)
Projects\PackagesConfigNuGetProject.cs (1)
292Thread.Sleep(100);
Utility\FileSystemUtility.cs (2)
432Thread.Sleep(100); 536Thread.Sleep(delayBeforeRetry);
Utility\MSBuildNuGetProjectSystemUtility.cs (2)
469Thread.Sleep(100); 507Thread.Sleep(delayBeforeRetry);
NuGet.Packaging (2)
PackageExtraction\ZipArchiveExtensions.cs (1)
142Thread.Sleep(1 << retry);
Signing\ChainBuilding\RetriableX509ChainBuildPolicy.cs (1)
76Thread.Sleep(SleepInterval);
PresentationCore (25)
System\Windows\Input\InputManager.cs (1)
142if(Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
System\Windows\Input\InputMethod.cs (1)
416Dispatcher dispatcher = Dispatcher.FromThread(Thread.CurrentThread);
System\Windows\Input\InputProcessorProfiles.cs (1)
35Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Initialize called on MTA thread!");
System\Windows\Input\InputProcessorProfilesLoader.cs (1)
56Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Load called on MTA thread!");
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (2)
293Thread inkingThread = new Thread(new ThreadStart(InkingThreadProc)); 307Thread.CurrentThread.Name = "DynamicRenderer";
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (2)
481Thread thread = new Thread(new ThreadStart(ThreadProc)) 1143Thread.CurrentThread.Name = "Stylus Input";
System\Windows\Input\TextServicesContext.cs (1)
46Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "SetDispatcherThreaad on MTA thread");
System\Windows\InterOp\HwndSource.cs (3)
24_threadSlot = Thread.AllocateDataSlot(); 2669object obj = Thread.GetData(_threadSlot); 2673Thread.SetData(_threadSlot, data);
System\Windows\Media\Effects\BitmapEffect.cs (1)
26if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
System\Windows\Media\HostVisual.cs (3)
135Debug.Assert(target.Dispatcher.Thread == Thread.CurrentThread); 188Debug.Assert(_target.Dispatcher.Thread == Thread.CurrentThread); 321Dispatcher channelDispatcher = Dispatcher.FromThread(Thread.CurrentThread);
System\Windows\Media\Imaging\BitmapDownload.cs (1)
439private static Thread _thread;
System\Windows\OleServicesContext.cs (8)
31private static readonly LocalDataStoreSlot s_threadDataSlot = Thread.AllocateDataSlot(); 56OleServicesContext oleServicesContext = (OleServicesContext)Thread.GetData(s_threadDataSlot); 64Thread.SetData(s_threadDataSlot, oleServicesContext); 89if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 112if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 125if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 141if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) 172if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
PresentationFramework (34)
Microsoft\Win32\CommonDialog.cs (3)
230if (_thread != Thread.CurrentThread) 318private readonly Thread _thread = Thread.CurrentThread;
MS\Internal\Data\ClrBindingWorker.cs (2)
388if (Dispatcher.Thread == Thread.CurrentThread) 413if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Controls\CalendarBlackoutDatesCollection.cs (3)
18private Thread _dispatcherThread; 30this._dispatcherThread = Thread.CurrentThread; 339return Thread.CurrentThread == this._dispatcherThread;
System\Windows\Controls\Grid.cs (3)
3125WeakReference tempDefinitionsWeakRef = (WeakReference)Thread.GetData(s_tempDefinitionsDataSlot); 3129Thread.SetData(s_tempDefinitionsDataSlot, new WeakReference(extData.TempDefinitions)); 3334private static readonly LocalDataStoreSlot s_tempDefinitionsDataSlot = Thread.AllocateDataSlot();
System\Windows\Controls\SelectedDatesCollection.cs (3)
19private Thread _dispatcherThread; 33this._dispatcherThread = Thread.CurrentThread; 469return Thread.CurrentThread == this._dispatcherThread;
System\Windows\Controls\SpellCheck.cs (1)
141new FrameworkPropertyMetadata(Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "de" ? SpellingReform.Postreform : SpellingReform.PreAndPostreform,
System\Windows\Controls\WebBrowser.cs (2)
291HRESULT hr = scriptObjectEx.GetIDsOfNames(ref guid, names, 1, Thread.CurrentThread.CurrentCulture.LCID, dispids); 319Thread.CurrentThread.CurrentCulture.LCID,
System\Windows\Data\BindingExpression.cs (1)
2495if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Data\BindingExpressionBase.cs (1)
432if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Data\BindingGroup.cs (1)
1493if (Dispatcher.Thread == Thread.CurrentThread)
System\Windows\Documents\Speller.cs (1)
50Thread.CurrentThread.CurrentCulture;
System\windows\Documents\TextEditor.cs (3)
1344store = (TextEditorThreadLocalStore)Thread.GetData(_threadLocalStoreSlot); 1349Thread.SetData(_threadLocalStoreSlot, store); 2017private static LocalDataStoreSlot _threadLocalStoreSlot = Thread.AllocateDataSlot();
System\Windows\Documents\TextServicesHost.cs (4)
61Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "OnRegisterTextStore must be called on STA thread"); 66_thread = Thread.CurrentThread; 372if (_thread == Thread.CurrentThread || System.Environment.OSVersion.Version.Major >= 6) 412private Thread _thread;
System\Windows\Documents\TextStore.cs (1)
2408Invariant.Assert(Thread.CurrentThread == _textservicesHost.Dispatcher.Thread, "GrantLock called on bad thread!");
System\Windows\Documents\WinRTSpellerInterop.cs (1)
54_defaultCulture = InputLanguageManager.Current?.CurrentInputLanguage ?? Thread.CurrentThread.CurrentCulture;
System\Windows\Interop\ActiveXHost.cs (1)
83if (Thread.CurrentThread.GetApartmentState() is not ApartmentState.STA)
System\Windows\Standard\Debug.cs (1)
338if (Thread.CurrentThread.GetApartmentState() != expectedState)
System\Windows\Standard\Verify.cs (1)
40if (Thread.CurrentThread.GetApartmentState() != requiredState)
System\Windows\SystemResources.cs (1)
1302Dispatcher dispatcher = isSysColorsOrSettingsChange ? null : Dispatcher.FromThread(System.Threading.Thread.CurrentThread);
PresentationUI (1)
MS\Internal\Documents\SigningProgress.cs (1)
51Thread dialogThread = new Thread(
ReachFramework (8)
PrintConfig\PTProvider.cs (3)
183this._thread = Thread.CurrentThread; 556if(_thread != Thread.CurrentThread) 843private Thread _thread;
PrintConfig\PTUtility.cs (1)
40return _resManager.GetString(key, System.Threading.Thread.CurrentThread.CurrentUICulture);
PrintSystemExceptions\PrintSystemException.cs (4)
221System.Threading.Thread.CurrentThread.CurrentUICulture); 240System.Threading.Thread.CurrentThread.CurrentUICulture); 244exceptionMessage = String.Format(System.Threading.Thread.CurrentThread.CurrentUICulture, 250exceptionMessage = String.Format(System.Threading.Thread.CurrentThread.CurrentUICulture,
Roslyn.Diagnostics.Analyzers (2)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
150Thread.Sleep(10);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
20if (Thread.CurrentThread.IsThreadPoolThread)
rzc (1)
DebugMode.cs (1)
19Thread.Sleep(TimeSpan.FromSeconds(3));
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)
1664((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)
618Thread.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(); 163Thread.MemoryBarrier(); 476Thread.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.Data.OleDb (6)
OleDbConnectionInternal.cs (2)
750if (ApartmentState.Unknown == Thread.CurrentThread.GetApartmentState()) 762Thread.CurrentThread.SetApartmentState(ApartmentState.MTA);
System\Data\ProviderBase\DbConnectionFactory.cs (1)
273Threading.Thread.Sleep(timeBetweenRetriesMilliseconds);
System\Data\ProviderBase\DbConnectionPool.cs (3)
929Debug.Assert(!Thread.CurrentThread.IsThreadPoolThread, "This thread may block for a long time. Threadpool threads should not be used."); 1075Thread waitOpenThread = new Thread(WaitForPendingOpen); 1408Thread waitOpenThread = new Thread(WaitForPendingOpen);
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\Metrics\AggregationManager.cs (1)
30private Thread? _collectThread;
System\Diagnostics\Metrics\CounterAggregator.cs (1)
37Thread.GetCurrentProcessorId()
System.Diagnostics.EventLog (5)
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (5)
67Thread.Sleep(0); 85Thread.BeginCriticalRegion(); 86Thread.BeginThreadAffinity(); 111Thread.EndThreadAffinity(); 112Thread.EndCriticalRegion();
System.Diagnostics.PerformanceCounter (10)
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (5)
67Thread.Sleep(0); 85Thread.BeginCriticalRegion(); 86Thread.BeginThreadAffinity(); 111Thread.EndThreadAffinity(); 112Thread.EndCriticalRegion();
System\Diagnostics\PerformanceCounterLib.cs (2)
1056System.Threading.Thread.Sleep(waitSleep); 1329System.Threading.Thread.Sleep(waitSleep);
System\Diagnostics\SharedPerformanceCounter.cs (3)
187Thread.MemoryBarrier(); 551Thread.Sleep(1); 1740System.Threading.Thread.Sleep(waitSleep);
System.DirectoryServices (2)
System\DirectoryServices\DirectoryEntry.cs (2)
523if (Thread.CurrentThread.GetApartmentState() == ApartmentState.Unknown) 524Thread.CurrentThread.SetApartmentState(ApartmentState.MTA);
System.DirectoryServices.AccountManagement (2)
System\DirectoryServices\AccountManagement\Context.cs (2)
97if (Thread.CurrentThread.GetApartmentState() == ApartmentState.Unknown) 98Thread.CurrentThread.SetApartmentState(ApartmentState.MTA);
System.DirectoryServices.Protocols (2)
System\DirectoryServices\Protocols\ldap\LdapPartialResultsProcessor.cs (2)
347var thread = new Thread(new ThreadStart(ThreadRoutine)) 375Thread.Sleep(250);
System.Drawing.Common (2)
System\Drawing\ImageAnimator.cs (2)
56private static Thread? s_animationThread; 393Thread.Sleep(AnimationDelayMS);
System.IO.FileSystem.Watcher (1)
System\IO\FileSystemWatcher.Linux.cs (1)
188Thread thread = new Thread(obj => ((INotify)obj!).ProcessEvents())
System.IO.Ports (1)
System\IO\Ports\SerialStream.Unix.cs (1)
945Thread.Sleep(1);
System.Management (3)
System\Management\InteropClasses\WMIInterop.cs (3)
1208Thread thread = new Thread(new ThreadStart(WorkerThread)); 1317if (Thread.CurrentThread.GetApartmentState() != ApartmentState.MTA) 1401private Thread thread;
System.Net.Sockets (1)
System\Net\Sockets\SocketAsyncEngine.Unix.cs (1)
198var thread = new Thread(static s => ((SocketAsyncEngine)s!).EventLoop())
System.Private.CoreLib (209)
Internal\Runtime\CompilerHelpers\StartupCode\StartupCodeHelpers.Extensions.cs (1)
66Thread.WaitForForegroundThreads();
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (23)
232public void Push(Thread thread) 238public void Pop(Thread thread) 264public Thread? CurrentThread; 273Thread? curThread = CurrentThread; 289stackState->Push(CurrentThread ??= Thread.CurrentThread); 681internal override void ExecuteDirectly(Thread? threadPoolThread) 709Thread? currentThread = state.CurrentThread; 1103SynchronizationContext? ctx = Thread.CurrentThreadAssumedInitialized._synchronizationContext; 1125if (continuationSyncCtx == Thread.CurrentThreadAssumedInitialized._synchronizationContext) 1278return ExecutionContext.CaptureForSuspension(Thread.CurrentThreadAssumedInitialized); 1282private static void RestoreExecutionContext(Thread thread, ExecutionContext? previousExecCtx) 1292private static void CaptureContexts(out Thread thread, out ExecutionContext? execCtx, out SynchronizationContext? syncCtx) 1294Thread curThread = Thread.CurrentThreadAssumedInitialized; 1305private static void RestoreContexts(bool resumed, Thread thread, ExecutionContext? previousExecCtx, SynchronizationContext? previousSyncCtx) 1331Thread thread = Thread.CurrentThreadAssumedInitialized; 1346SynchronizationContext? syncCtx = Thread.CurrentThreadAssumedInitialized._synchronizationContext; 1366private static void CaptureContinuationContextFlags(ref ContinuationFlags flags, Thread currentThread) 1390Thread thread = Thread.CurrentThreadAssumedInitialized; 1432Thread thread = Thread.CurrentThreadAssumedInitialized;
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeAsyncTaskContinuation.cs (2)
51SynchronizationContext? ctx = Thread.CurrentThread._synchronizationContext; 74if (canInline && continuationSyncCtx == Thread.CurrentThread._synchronizationContext)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffer.cs (4)
164Thread.FastPollGC(); 189Thread.FastPollGC(); 202Thread.FastPollGC(); 207Thread.FastPollGC();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (2)
350int index = (int)((uint)Thread.GetCurrentProcessorId() % (uint)SharedArrayPoolStatics.s_partitionCount); // mod by constant in tier 1 370int index = (int)((uint)Thread.GetCurrentProcessorId() % (uint)SharedArrayPoolStatics.s_partitionCount); // mod by constant in tier 1
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ActivityTracker.cs (1)
362int appDomainID = Thread.GetDomainID();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (1)
294private static Thread? s_pollingThread;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.Threads.cs (1)
39Thread.Sleep(10);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
3002Thread.Sleep(15); 4304osThreadId = (long)Thread.CurrentOSThreadId;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (2)
28Thread currentThread = Thread.CurrentThread;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.cs (6)
493OsThreadId = Thread.CurrentOSThreadId; 947AsyncThreadContextHolder contextHolder = new AsyncThreadContextHolder(context, Thread.CurrentThread); 1039if (!contextHolder.OwnerThread.TryGetTarget(out Thread? target) || !target.IsAlive) 1113public AsyncThreadContextHolder(AsyncThreadContext context, Thread ownerThread) 1116OwnerThread = new WeakReference<Thread>(ownerThread); 1120public readonly WeakReference<Thread> OwnerThread;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (3)
158ExecutionContext? currentContext = ExecutionContext.CaptureForSuspension(Thread.CurrentThread); 347internal sealed override void ExecuteDirectly(Thread? threadPoolThread) => MoveNext(threadPoolThread); 352private void MoveNext(Thread? threadPoolThread)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (2)
157ExecutionContext? currentContext = ExecutionContext.CaptureForSuspension(Thread.CurrentThread); 359int i = (int)((uint)Thread.GetCurrentProcessorId() % (uint)Environment.ProcessorCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Backoff.cs (1)
34Thread.SpinWait((int)spins);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (30)
56ExecutionContext? executionContext = Thread.CurrentThread._executionContext; 81return Thread.CurrentThread._executionContext; 86internal static ExecutionContext? CaptureForSuspension(Thread currentThread) 88Debug.Assert(Thread.CurrentThread == currentThread); 115Thread currentThread = Thread.CurrentThread; 130Thread currentThread = Thread.CurrentThread; 142ExecutionContext? executionContext = Thread.CurrentThread._executionContext; 171Thread currentThread = Thread.CurrentThread; 244Thread currentThread = Thread.CurrentThread; 265internal static void RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext? executionContext, ContextCallback callback, object state) 267Debug.Assert(threadPoolThread == Thread.CurrentThread); 292Thread currentThread = threadPoolThread; 318Thread.CurrentThread._executionContext = executionContext; 329internal static void RestoreChangedContextToThread(Thread currentThread, ExecutionContext? contextToRestore, ExecutionContext? currentContext) 331Debug.Assert(currentThread == Thread.CurrentThread); 346internal static void ResetThreadPoolThread(Thread currentThread) 367Debug.Assert(!RuntimeFeature.IsMultithreadingSupported || Thread.CurrentThread.IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 368Debug.Assert(Thread.CurrentThread._executionContext == null, "ThreadPool thread not on Default ExecutionContext."); 369Debug.Assert(Thread.CurrentThread._synchronizationContext == null, "ThreadPool thread not on Default SynchronizationContext."); 467ExecutionContext? current = Thread.CurrentThread._executionContext; 481ExecutionContext? current = Thread.CurrentThread._executionContext; 545Thread.CurrentThread._executionContext = 569private Thread? _thread; 571internal void Initialize(Thread currentThread) 573Debug.Assert(currentThread == Thread.CurrentThread); 584if (Thread.CurrentThread != _thread)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Lock.cs (2)
758Thread.UninterruptibleSleep0(); 762Thread.SpinWait(1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLifoSemaphore.cs (2)
231Thread.UninterruptibleSleep0(); 232Thread.SpinWait(1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLock.cs (5)
30private Thread? _ownerThread; 50bool isLocked = _ownerThread == Thread.CurrentThread; 61Debug.Assert(_ownerThread == Thread.CurrentThread); 71Debug.Assert(_ownerThread != Thread.CurrentThread); 98_ownerThread = Thread.CurrentThread;
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelSpinWaiter.cs (3)
74int n = Thread.OptimalMaxSpinWaitsPerSpinIteration; 79Thread.SpinWait(n); 85Thread.UninterruptibleSleep0();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\NamedMutex.Unix.cs (17)
13internal sealed class NamedMutexOwnershipChain(Thread thread) 15private readonly Thread _thread = thread; 89private Thread? _lockOwnerThread; 95public bool IsLockOwnedByCurrentThread => IsLockOwnedByThreadInThisProcess(Thread.CurrentThread); 96protected abstract bool IsLockOwnedByThreadInThisProcess(Thread thread); 151Thread.CurrentThread.WaitInfo.NamedMutexOwnershipChain.Remove(this); 163public void Abandon(NamedMutexOwnershipChain chain, Thread abandonedThread) 178Debug.Assert(IsLockOwnedByCurrentThread || (!abandonedThread.IsAlive && Thread.CurrentThreadIsFinalizerThread()), 183Debug.Assert(Thread.CurrentThreadIsFinalizerThread()); 251MutexTryAcquireLockResult acquireResult = processDataHeader._processData.TryAcquireLock(Thread.CurrentThread.WaitInfo, timeoutMilliseconds: 0, ref creationDeletionProcessLock); 289Thread.CurrentThread.WaitInfo.NamedMutexOwnershipChain.Remove(this); 299protected override bool IsLockOwnedByThreadInThisProcess(Thread thread) 311(uint)Thread.CurrentThread.ManagedThreadId); 426protected override bool IsLockOwnedByThreadInThisProcess(Thread thread) 435_sharedData->LockOwnerThreadId = (uint)Thread.CurrentThread.ManagedThreadId; 524Thread.Sleep(PollLoopMaximumSleepMilliseconds); 561Thread.Sleep(sleepMilliseconds);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ParameterizedThreadStart.cs (1)
7/// Represents the method that executes on a <see cref="Thread" />.
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Blocking.cs (2)
34if (!BlockingConfig.IsCooperativeBlockingEnabled || !Thread.CurrentThread.IsThreadPoolThread) 71Debug.Assert(Thread.CurrentThread.IsThreadPoolThread);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.GateThread.cs (1)
263Thread gateThread = new Thread(GateThreadStart, SmallStackSizeBytes)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (1)
186Thread waitThread = new Thread(WaitThreadStart, SmallStackSizeBytes)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerThread.cs (1)
59Thread workerThread = new Thread(s_workerThreadStart);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ProcessorIdCache.cs (4)
31int currentProcessorId = Thread.GetCurrentProcessorNumber(); 52return Thread.GetCurrentProcessorNumber(); 78if (Thread.GetCurrentProcessorNumber() < 0) 96Thread.GetCurrentProcessorNumber();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (4)
1231Thread.SpinWait(LockSpinCycles * spinCount); 1235Thread.Sleep(0); 1570Thread.SpinWait( 1576Thread.Sleep(0);
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
593if (isDefaultScheduler && taskWasPreviouslyQueued && !Thread.CurrentThread.IsThreadPoolThread)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (3)
2417internal virtual void ExecuteDirectly(Thread? threadPoolThread) => ExecuteEntryUnsafe(threadPoolThread); 2419internal void ExecuteEntryUnsafe(Thread? threadPoolThread) // used instead of ExecuteEntry() when we don't have to worry about double-execution prevent 2447private void ExecuteWithThreadLocal(ref Task? currentTaskSlot, Thread? threadPoolThread = null)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (1)
489(TaskScheduler.InternalCurrent == m_scheduler || Thread.CurrentThread.IsThreadPoolThread);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (7)
23private static Thread? t_currentThread; 81Thread thread = Thread.CurrentThread; 361public static Thread CurrentThread 387internal static Thread CurrentThreadAssumedInitialized 391Thread? thread = t_currentThread; 656/// Manages functionality required to support members of <see cref="Thread"/> dealing with thread-local data
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.Unix.cs (1)
39internal static void UninterruptibleSleep0() => Thread.Yield();
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (6)
894Thread currentThread = tl.currentThread; 1035private static void DispatchWorkItemWithWorkerTracking(object workItem, Thread currentThread) 1038Debug.Assert(currentThread == Thread.CurrentThread); 1055private static void DispatchWorkItem(object workItem, Thread currentThread) 1089public readonly Thread currentThread; 1100currentThread = Thread.CurrentThread;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadStart.cs (1)
7/// Represents the method that executes on a <see cref="Thread" />.
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (2)
505_associatedTimerQueue = TimerQueue.Instances[(uint)Thread.GetCurrentProcessorId() % TimerQueue.Instances.Length]; 720ExecutionContext.RunFromThreadPoolDispatchLoop(Thread.CurrentThread, context, s_callCallbackInContext, this);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (1)
38Thread timerThread = new Thread(TimerThread)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.HandleManager.Unix.cs (1)
22Debug.Assert(waitInfo.Thread == Thread.CurrentThread);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.ThreadWaitInfo.Unix.cs (14)
19private readonly Thread _thread; 99public ThreadWaitInfo(Thread thread) 118public Thread Thread => _thread; 135Debug.Assert(_thread == Thread.CurrentThread); 155Debug.Assert(_thread == Thread.CurrentThread); 180Debug.Assert(_thread == Thread.CurrentThread); 254Debug.Assert(_thread == Thread.CurrentThread); 299Debug.Assert(_thread == Thread.CurrentThread); 398Thread.Yield(); 408if (interruptible && Thread.CurrentThread.WaitInfo.CheckAndResetPendingInterrupt_NotLocked) 419Thread 429Debug.Assert(_thread != Thread.CurrentThread); 695Debug.Assert(_waitInfo.Thread == Thread.CurrentThread); 718Debug.Assert(_waitInfo.Thread == Thread.CurrentThread);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.Unix.cs (6)
28/// out of a wait state. Each thread has an instance available through <see cref="Thread.WaitInfo"/>. 191ThreadWaitInfo waitInfo = Thread.CurrentThread.WaitInfo; 370return waitableObject.Wait(Thread.CurrentThread.WaitInfo, timeoutMilliseconds, interruptible, prioritize); 382ThreadWaitInfo waitInfo = Thread.CurrentThread.WaitInfo; 481ThreadWaitInfo waitInfo = Thread.CurrentThread.WaitInfo; 519public static void Interrupt(Thread thread)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.WaitableObject.Unix.cs (9)
312Debug.Assert(waitInfo.Thread == Thread.CurrentThread); 363Debug.Assert(waitInfo.Thread == Thread.CurrentThread); 502Thread waitingThread, 511Debug.Assert(waitingThread != Thread.CurrentThread); 566Debug.Assert(waitInfo.Thread != Thread.CurrentThread); 762if (IsSignaled || _ownershipInfo!.Thread != Thread.CurrentThread) 821private Thread? _thread; 835public Thread? Thread 943Debug.Assert(_thread == Thread.CurrentThread);
System\GC.NativeAot.cs (1)
479RuntimeImports.RhWaitForPendingFinalizers(Thread.ReentrantWaitsEnabled);
System\RuntimeExceptionHelpers.cs (4)
206crashInfo.Open(reason, Thread.CurrentOSThreadId, message ?? GetStringForFailFastReason(reason)); 222Thread.Sleep(1); 234ulong currentThreadId = Thread.CurrentOSThreadId; 318Thread.Sleep(int.MaxValue);
System\Threading\ObjectHeader.cs (1)
427Thread.SpinWaitInternal(i);
System\Threading\Thread.NativeAot.cs (9)
87private static Thread InitializeCurrentThread() 91var currentThread = new Thread(); 211if (Thread.CurrentThread != this) 366GCHandle<Thread> threadHandle = new GCHandle<Thread>(this); 409Thread thread = GCHandle<Thread>.FromIntPtr(parameter).Target; 455private static void StopThread(Thread thread) 486Thread.CurrentThread.IsBackground = true;
System\Threading\Thread.NativeAot.Unix.cs (3)
49Thread? currentThread = t_currentThread; 60private unsafe bool CreateThread(GCHandle<Thread> thisThreadHandle) 74if (!Interop.Sys.CreateThread(stackSize, RuntimeImports.RhGetThreadEntryPointAddress(), GCHandle<Thread>.ToIntPtr(thisThreadHandle)))
System.Private.Windows.Core (5)
System\Private\Windows\Ole\ClipboardCore.cs (5)
61Thread.Sleep(millisecondsTimeout: retryDelay); 95Thread.Sleep(millisecondsTimeout: retryDelay); 139Thread.Sleep(millisecondsTimeout: retryDelay); 156Thread.Sleep(millisecondsTimeout: retryDelay); 199Thread.Sleep(millisecondsTimeout: retryDelay);
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.AccessControl (4)
System\Security\AccessControl\Privilege.cs (4)
35private readonly Thread currentThread = Thread.CurrentThread; 404if (!this.currentThread.Equals(Thread.CurrentThread)) 515if (!this.currentThread.Equals(Thread.CurrentThread))
System.Security.Claims (1)
System\Security\Claims\ClaimsPrincipal.cs (1)
41IPrincipal? threadPrincipal = Thread.CurrentPrincipal;
System.Security.Cryptography (1)
System\Security\Cryptography\PasswordDeriveBytes.Windows.cs (1)
47System.Threading.Thread.MemoryBarrier();
System.Security.Permissions (1)
System\Security\Permissions\PrincipalPermission.cs (1)
226IPrincipal principal = Thread.CurrentPrincipal;
System.ServiceModel.Primitives (5)
Internals\System\Runtime\IOThreadScheduler.cs (2)
477Thread.CurrentThread.Name = "IOThreadScheduler.IOCallback"; 537var thread = new Thread(new ThreadStart(Callback));
Internals\System\Runtime\TaskHelpers.cs (2)
388if (!Thread.CurrentThread.IsThreadPoolThread) 398Fx.Assert(Thread.CurrentThread.IsThreadPoolThread, "We should be running on the thread pool");
System\ServiceModel\Channels\ReliableOutputSessionChannel.cs (1)
775if (Thread.CurrentThread.IsThreadPoolThread)
System.ServiceProcess.ServiceController (1)
System\ServiceProcess\ServiceController.cs (1)
992Thread.Sleep(250);
System.Speech (4)
Internal\SapiInterop\SapiProxy.cs (1)
244private Thread _mta;
Internal\SapiInterop\SapiRecognizer.cs (1)
36if (!IsSapi53 && System.Threading.Thread.CurrentThread.GetApartmentState() == System.Threading.ApartmentState.STA)
Internal\Synthesis\VoiceSynthesis.cs (2)
1596Thread.Sleep(100); 1767private Thread _workerThread;
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)
src\runtime\artifacts\obj\System.Threading.Thread\Release\net11.0\System.Threading.Thread.Forwards.cs (1)
7[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.Thread))]
System.Transactions.Local (20)
System\Transactions\DtcProxyShim\OletxHelper.cs (1)
51Thread.Sleep(RetryInterval);
System\Transactions\Oletx\OletxEnlistment.cs (1)
631Thread.MemoryBarrier();
System\Transactions\Oletx\OletxResourceManager.cs (4)
45internal Thread? reenlistThread; 142Thread.MemoryBarrier(); 538resourceManager.reenlistThread = Thread.CurrentThread; 863Thread.MemoryBarrier();
System\Transactions\Oletx\OletxTransaction.cs (2)
412Thread.MemoryBarrier(); 1152Thread.MemoryBarrier();
System\Transactions\Oletx\OletxTransactionManager.cs (4)
77Thread.BeginCriticalRegion(); 88Thread.BeginThreadAffinity(); 116Thread.EndThreadAffinity(); 351Thread.EndCriticalRegion();
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)
547System.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)
223get => Thread.CurrentThread.CurrentCulture; 224set => Thread.CurrentThread.CurrentCulture = value; 379Thread.Yield(); 1283=> 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)
238_enterModalHandler(Thread.CurrentThread, EventArgs.Empty); 425_leaveModalHandler(Thread.CurrentThread, EventArgs.Empty); 594_threadExceptionHandler(Thread.CurrentThread, new ThreadExceptionEventArgs(ex));
System\Windows\Forms\Control.cs (1)
11887Thread.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.Design (1)
System\Windows\Forms\Design\MaskDescriptor.cs (1)
41public virtual CultureInfo Culture => Thread.CurrentThread.CurrentCulture;
System.Xaml (1)
System\Xaml\XamlBackgroundReader.cs (1)
33private Thread _thread;
UIAutomationClient (3)
MS\Internal\Automation\HwndProxyElementProvider.cs (2)
476Thread.Sleep( 100 ); 1620System.Threading.Thread.Sleep(1);
MS\Internal\Automation\QueueProcessor.cs (1)
186private Thread _thread; // the thread on which QueueItem's are processed
UIAutomationClientSideProviders (14)
MS\Internal\AutomationProxies\Misc.cs (2)
111System.Threading.Thread.Sleep(1); 969System.Threading.Thread.Sleep(50);
MS\Internal\AutomationProxies\QueueProcessor.cs (1)
58Thread thread = new Thread(threadStart)
MS\Internal\AutomationProxies\WindowsButton.cs (1)
509System.Threading.Thread.Sleep(1);
MS\Internal\AutomationProxies\WindowsListViewItem.cs (1)
794System.Threading.Thread.Sleep(1);
MS\Internal\AutomationProxies\WindowsMenu.cs (8)
1448System.Threading.Thread.Sleep(1); 1496System.Threading.Thread.Sleep(100); 1510System.Threading.Thread.Sleep(1); 1516System.Threading.Thread.Sleep(100); 2166System.Threading.Thread.Sleep(10); 2269System.Threading.Thread.Sleep(1); 2322System.Threading.Thread.Sleep(1); 2335System.Threading.Thread.Sleep(1);
MS\Internal\AutomationProxies\WindowsTreeView.cs (1)
623System.Threading.Thread.Sleep(1);
UIAutomationTypes (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\HandleCollector.cs (1)
129System.Threading.Thread.Sleep(sleep);
vbc (3)
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
184var thread = new Thread(action);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
819Thread.Sleep(1); 910Thread.Sleep(1);
VBCSCompiler (3)
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
184var thread = new Thread(action);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
819Thread.Sleep(1); 910Thread.Sleep(1);