Skip to content

Commit ea20228

Browse files
authored
Add boolean field to indicate whether or not the Windows thread pool is being used (#90551)
1 parent f9b07d4 commit ea20228

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Windows.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ public static partial class ThreadPool
1313
internal static bool UseWindowsThreadPool { get; } =
1414
AppContextConfigHelper.GetBooleanConfig("System.Threading.ThreadPool.UseWindowsThreadPool", "DOTNET_ThreadPool_UseWindowsThreadPool");
1515

16+
#pragma warning disable CA1823
17+
// The field should reflect what the property returns because the property can be stubbed by trimming,
18+
// such that sos reflects the actual state of what thread pool is being used and not just the config value.
19+
private static readonly bool s_useWindowsThreadPool = UseWindowsThreadPool; // Name relied on by sos
20+
#pragma warning restore CA1823
21+
1622
#if NATIVEAOT
1723
private const bool IsWorkerTrackingEnabledInConfig = false;
1824
#else

0 commit comments

Comments
 (0)