summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoundinya Veluri <kouvel@users.noreply.github.com>2017-11-04 19:01:39 -0700
committerGitHub <noreply@github.com>2017-11-04 19:01:39 -0700
commit4be1b4b90f17418e5784a269cc5214efe24a5afa (patch)
tree9c99c742dc5426926f8953cd9e3a1a426fb7e0ca
parentae8891aac45bf296bc22a8c9ea051c77d3cada80 (diff)
downloadcoreclr-4be1b4b90f17418e5784a269cc5214efe24a5afa.tar.gz
coreclr-4be1b4b90f17418e5784a269cc5214efe24a5afa.tar.bz2
coreclr-4be1b4b90f17418e5784a269cc5214efe24a5afa.zip
Limit min threads in thread pool to 1 (#14864)
Related to https://github.com/dotnet/coreclr/issues/14239
-rw-r--r--src/vm/win32threadpool.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vm/win32threadpool.cpp b/src/vm/win32threadpool.cpp
index 4210060755..34097feca7 100644
--- a/src/vm/win32threadpool.cpp
+++ b/src/vm/win32threadpool.cpp
@@ -617,7 +617,7 @@ BOOL ThreadpoolMgr::SetMinThreads(DWORD MinWorkerThreads,
if (GetForceMinWorkerThreadsValue() == 0)
{
- MinLimitTotalWorkerThreads = min(MinWorkerThreads, (DWORD)ThreadCounter::MaxPossibleCount);
+ MinLimitTotalWorkerThreads = max(1, min(MinWorkerThreads, (DWORD)ThreadCounter::MaxPossibleCount));
ThreadCounter::Counts counts = WorkerCounter.GetCleanCounts();
while (counts.MaxWorking < MinLimitTotalWorkerThreads)
@@ -647,7 +647,7 @@ BOOL ThreadpoolMgr::SetMinThreads(DWORD MinWorkerThreads,
END_SO_INTOLERANT_CODE;
- MinLimitTotalCPThreads = min(MinIOCompletionThreads, (DWORD)ThreadCounter::MaxPossibleCount);
+ MinLimitTotalCPThreads = max(1, min(MinIOCompletionThreads, (DWORD)ThreadCounter::MaxPossibleCount));
init_result = TRUE;
}