8 instantiations of ThreadLocal
Aspire.Hosting.Testing (1)
DistributedApplicationEntryPointInvoker.cs (1)
211private static readonly ThreadLocal<TestingBuilderFactory?> s_currentListener = new();
Microsoft.Extensions.Caching.Memory (1)
MemoryCache.cs (1)
63_stats = new ThreadLocal<Stats>(() => new Stats(this));
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());
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\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
31private readonly ThreadLocal<ProcessingMode> m_threadProcessingMode = new ThreadLocal<ProcessingMode>();
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (1)
661return new LocalDataStoreSlot(new ThreadLocal<object?>());
36 references to ThreadLocal
Aspire.Hosting.Testing (1)
DistributedApplicationEntryPointInvoker.cs (1)
211private static readonly ThreadLocal<TestingBuilderFactory?> s_currentListener = new();
Microsoft.CodeAnalysis.CodeStyle (2)
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.EditorFeatures (3)
IntelliSense\AsyncCompletion\ItemManager.CompletionListUpdater.cs (3)
136var threadLocalPatternMatchHelper = new ThreadLocal<PatternMatchHelper>(() => new PatternMatchHelper(_filterText), trackAllValues: true); 199IAsyncCompletionSession session, IReadOnlyList<MatchResult> itemsToBeIncluded, ThreadLocal<PatternMatchHelper> patternMatcherHelper, CancellationToken cancellationToken) 240private async Task AddCompletionItemsAsync(List<MatchResult> list, ThreadLocal<PatternMatchHelper> threadLocalPatternMatchHelper, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Workspaces (2)
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)
33private readonly ThreadLocal<Stats>? _stats;
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\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<>))]
System.Collections.Concurrent (1)
System\Collections\Concurrent\ConcurrentBag.cs (1)
36private readonly ThreadLocal<WorkStealingQueue> _locals;
System.Private.CoreLib (20)
src\libraries\System.Private.CoreLib\src\System\LocalDataStoreSlot.cs (2)
11internal LocalDataStoreSlot(ThreadLocal<object?> data) 17internal ThreadLocal<object?> Data { get; }
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
31private readonly ThreadLocal<ProcessingMode> m_threadProcessingMode = new ThreadLocal<ProcessingMode>();
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (1)
710private static ThreadLocal<object?> GetThreadLocal(LocalDataStoreSlot slot)
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. 422/// The <see cref="ThreadLocal{T}"/> instance has been disposed. 479/// The <see cref="ThreadLocal{T}"/> instance has been disposed. 765private readonly ThreadLocal<T> _tlocal; 769public SystemThreading_ThreadLocalDebugView(ThreadLocal<T> tlocal)
System.Threading (1)
artifacts\obj\System.Threading\Debug\net10.0\System.Threading.Forwards.cs (1)
30[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadLocal<>))]