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 885db3793d52..664049c61ed4 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 {