* Add boolean field to indicate whether or not the Windows thread pool is being used
* Update src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Windows.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Remove trailing spaces
* Move comment
* Update fields and comments
* Disable CA1823 - unused field
---------
Co-authored-by: unknown <eduardo.velarde@pucp.pe>
Co-authored-by: Eduardo Velarde <32459232+eduardo-vp@users.noreply.github.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
internal static bool UseWindowsThreadPool { get; } =
AppContextConfigHelper.GetBooleanConfig("System.Threading.ThreadPool.UseWindowsThreadPool", "DOTNET_ThreadPool_UseWindowsThreadPool");
+#pragma warning disable CA1823
+ // The field should reflect what the property returns because the property can be stubbed by trimming,
+ // such that sos reflects the actual state of what thread pool is being used and not just the config value.
+ private static readonly bool s_useWindowsThreadPool = UseWindowsThreadPool; // Name relied on by sos
+#pragma warning restore CA1823
+
#if NATIVEAOT
private const bool IsWorkerTrackingEnabledInConfig = false;
#else