26 instantiations of ThreadLocal
Aspire.Hosting.Testing (1)
DistributedApplicationEntryPointInvoker.cs (1)
211private static readonly ThreadLocal<TestingBuilderFactory?> s_currentListener = new();
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
104new(() => InitializeMatrix(new int[MaxMatrixPoolDimension, MaxMatrixPoolDimension])); 112new(() => new int[LastSeenIndexLength]);
ILCompiler.MetadataTransform (1)
Internal\Metadata\NativeFormat\Writer\NativeFormatWriterGen.cs (1)
2124_equalsReentrancyGuard = new ThreadLocal<ReentrancyGuardStack>(() => new ReentrancyGuardStack());
Microsoft.CodeAnalysis.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
104new(() => InitializeMatrix(new int[MaxMatrixPoolDimension, MaxMatrixPoolDimension])); 112new(() => new int[LastSeenIndexLength]);
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
104new(() => InitializeMatrix(new int[MaxMatrixPoolDimension, MaxMatrixPoolDimension])); 112new(() => new int[LastSeenIndexLength]);
Microsoft.CodeAnalysis.CodeStyle (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
104new(() => InitializeMatrix(new int[MaxMatrixPoolDimension, MaxMatrixPoolDimension])); 112new(() => new int[LastSeenIndexLength]);
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
104new(() => InitializeMatrix(new int[MaxMatrixPoolDimension, MaxMatrixPoolDimension])); 112new(() => new int[LastSeenIndexLength]);
Microsoft.CodeAnalysis.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
104new(() => InitializeMatrix(new int[MaxMatrixPoolDimension, MaxMatrixPoolDimension])); 112new(() => new int[LastSeenIndexLength]);
Microsoft.Extensions.Caching.Memory (1)
MemoryCache.cs (1)
73_stats = new ThreadLocal<StatsHandler>(() => new StatsHandler(this));
Microsoft.Extensions.Http.Resilience (1)
Internal\Randomizer.cs (1)
18private static readonly System.Threading.ThreadLocal<Random> _randomInstance = new(() => new Random());
Microsoft.Extensions.Telemetry (1)
Sampling\RandomProbabilisticSampler.cs (1)
26private static readonly System.Threading.ThreadLocal<Random> _randomInstance = new(() => new Random());
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (1)
src\Graphics\src\Graphics\Platforms\Windows\PlatformGraphicsService.cs (1)
20 private static readonly ThreadLocal<ICanvasResourceCreator> _threadLocalCreator = new ThreadLocal<ICanvasResourceCreator>();
Microsoft.ML.AutoML (1)
AutoMlUtils.cs (1)
15public static readonly ThreadLocal<Random> Random = new ThreadLocal<Random>(() => new Random());
Roslyn.Diagnostics.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
104new(() => InitializeMatrix(new int[MaxMatrixPoolDimension, MaxMatrixPoolDimension])); 112new(() => new int[LastSeenIndexLength]);
System.Collections.Concurrent (2)
System\Collections\Concurrent\ConcurrentBag.cs (2)
45_locals = new ThreadLocal<WorkStealingQueue>(); 60_locals = new ThreadLocal<WorkStealingQueue>();
System.Private.CoreLib (2)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
31private readonly ThreadLocal<ProcessingMode> m_threadProcessingMode = new ThreadLocal<ProcessingMode>();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (1)
664return new LocalDataStoreSlot(new ThreadLocal<object?>());
System.ServiceModel.Primitives (1)
Internals\System\Runtime\IOThreadScheduler.cs (1)
62private static readonly ThreadLocal<bool> s_isIoThread = new();
47 references to ThreadLocal
Aspire.Hosting.Testing (1)
DistributedApplicationEntryPointInvoker.cs (1)
211private static readonly ThreadLocal<TestingBuilderFactory?> s_currentListener = new();
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
103private static readonly ThreadLocal<int[,]> t_matrixPool = 111private static readonly ThreadLocal<int[]> t_lastSeenIndexPool =
ILCompiler.MetadataTransform (1)
Internal\Metadata\NativeFormat\Writer\NativeFormatWriterGen.cs (1)
2163private ThreadLocal<ReentrancyGuardStack> _equalsReentrancyGuard;
Microsoft.CodeAnalysis.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
103private static readonly ThreadLocal<int[,]> t_matrixPool = 111private static readonly ThreadLocal<int[]> t_lastSeenIndexPool =
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
103private static readonly ThreadLocal<int[,]> t_matrixPool = 111private static readonly ThreadLocal<int[]> t_lastSeenIndexPool =
Microsoft.CodeAnalysis.CodeStyle (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
103private static readonly ThreadLocal<int[,]> t_matrixPool = 111private static readonly ThreadLocal<int[]> t_lastSeenIndexPool =
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
103private static readonly ThreadLocal<int[,]> t_matrixPool = 111private static readonly ThreadLocal<int[]> t_lastSeenIndexPool =
Microsoft.CodeAnalysis.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
103private static readonly ThreadLocal<int[,]> t_matrixPool = 111private static readonly ThreadLocal<int[]> t_lastSeenIndexPool =
Microsoft.Extensions.Caching.Memory (1)
MemoryCache.cs (1)
35private readonly ThreadLocal<StatsHandler>? _stats;
Microsoft.Extensions.Http.Resilience (1)
Internal\Randomizer.cs (1)
18private static readonly System.Threading.ThreadLocal<Random> _randomInstance = new(() => new Random());
Microsoft.Extensions.Telemetry (1)
Sampling\RandomProbabilisticSampler.cs (1)
26private static readonly System.Threading.ThreadLocal<Random> _randomInstance = new(() => new Random());
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (1)
src\Graphics\src\Graphics\Platforms\Windows\PlatformGraphicsService.cs (1)
20 private static readonly ThreadLocal<ICanvasResourceCreator> _threadLocalCreator = new ThreadLocal<ICanvasResourceCreator>();
Microsoft.ML.AutoML (1)
AutoMlUtils.cs (1)
15public static readonly ThreadLocal<Random> Random = new ThreadLocal<Random>(() => new Random());
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\MyServices\Internal\ContextValue.vb (1)
22Private Shared s_threadLocal As ThreadLocal(Of IDictionary)
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1175[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadLocal<>))]
netstandard (1)
netstandard.cs (1)
2138[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadLocal<>))]
Roslyn.Diagnostics.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
103private static readonly ThreadLocal<int[,]> t_matrixPool = 111private static readonly ThreadLocal<int[]> t_lastSeenIndexPool =
System.Collections.Concurrent (1)
System\Collections\Concurrent\ConcurrentBag.cs (1)
36private readonly ThreadLocal<WorkStealingQueue> _locals;
System.Private.CoreLib (20)
src\runtime\src\libraries\System.Private.CoreLib\src\System\LocalDataStoreSlot.cs (2)
11internal LocalDataStoreSlot(ThreadLocal<object?> data) 17internal ThreadLocal<object?> Data { get; }
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
31private readonly ThreadLocal<ProcessingMode> m_threadProcessingMode = new ThreadLocal<ProcessingMode>();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (1)
713private static ThreadLocal<object?> GetThreadLocal(LocalDataStoreSlot slot)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (16)
22/// <see cref="ThreadLocal{T}"/> are thread-safe and may be used 68/// Initializes the <see cref="ThreadLocal{T}"/> instance. 76/// Initializes the <see cref="ThreadLocal{T}"/> instance. 86/// Initializes the <see cref="ThreadLocal{T}"/> instance with the 104/// Initializes the <see cref="ThreadLocal{T}"/> instance with the 136/// Releases the resources used by this <see cref="ThreadLocal{T}" /> instance. 147/// Releases the resources used by this <see cref="ThreadLocal{T}" /> instance. 150/// Unlike most of the members of <see cref="ThreadLocal{T}"/>, this method is not thread-safe. 159/// Releases the resources used by this <see cref="ThreadLocal{T}" /> instance. 165/// Unlike most of the members of <see cref="ThreadLocal{T}"/>, this method is not thread-safe. 220/// The <see cref="ThreadLocal{T}"/> instance has been disposed. 238/// The <see cref="ThreadLocal{T}"/> instance has been disposed. 419/// The <see cref="ThreadLocal{T}"/> instance has been disposed. 476/// The <see cref="ThreadLocal{T}"/> instance has been disposed. 759private readonly ThreadLocal<T> _tlocal; 763public SystemThreading_ThreadLocalDebugView(ThreadLocal<T> tlocal)
System.ServiceModel.Primitives (1)
Internals\System\Runtime\IOThreadScheduler.cs (1)
62private static readonly ThreadLocal<bool> s_isIoThread = new();
System.Threading (1)
src\runtime\artifacts\obj\System.Threading\Release\net11.0\System.Threading.Forwards.cs (1)
30[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadLocal<>))]