diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolCallbackWrapper.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolCallbackWrapper.cs index 885db3793d524..664049c61ed4e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolCallbackWrapper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolCallbackWrapper.cs @@ -13,8 +13,10 @@ public static ThreadPoolCallbackWrapper Enter() if (!currentThread.IsThreadPoolThread) { currentThread.IsThreadPoolThread = true; +#if TARGET_WINDOWS // when using the Windows Threadpool, this is needed to increment the ThreadCount ThreadPool.InitializeForThreadPoolThread(); +#endif } return new ThreadPoolCallbackWrapper {