summaryrefslogtreecommitdiff
path: root/src/vm/win32threadpool.cpp
diff options
context:
space:
mode:
authorKoundinya Veluri <kouvel@microsoft.com>2016-11-22 19:14:13 -0800
committerGitHub <noreply@github.com>2016-11-22 19:14:13 -0800
commit74015760d85127bdda68a520d2c0fe5f8bb667ed (patch)
treedd0a69598ac2b54a8f868e45f0067362a04dc9eb /src/vm/win32threadpool.cpp
parent20f48eb1128261332a99503a22b86c3891fdb9cc (diff)
downloadcoreclr-74015760d85127bdda68a520d2c0fe5f8bb667ed.tar.gz
coreclr-74015760d85127bdda68a520d2c0fe5f8bb667ed.tar.bz2
coreclr-74015760d85127bdda68a520d2c0fe5f8bb667ed.zip
Fix ThreadPool.SetMaxThreads to not allow having zero available threads (#8256)
There is an assertion checking for this, so allowing zero is probably not intentional. Related to #8236
Diffstat (limited to 'src/vm/win32threadpool.cpp')
-rw-r--r--src/vm/win32threadpool.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vm/win32threadpool.cpp b/src/vm/win32threadpool.cpp
index 1b4a8690e0..98c7d3ea81 100644
--- a/src/vm/win32threadpool.cpp
+++ b/src/vm/win32threadpool.cpp
@@ -532,7 +532,9 @@ BOOL ThreadpoolMgr::SetMaxThreadsHelper(DWORD MaxWorkerThreads,
CrstHolder csh(&WorkerCriticalSection);
if (MaxWorkerThreads >= (DWORD)MinLimitTotalWorkerThreads &&
- MaxIOCompletionThreads >= (DWORD)MinLimitTotalCPThreads)
+ MaxIOCompletionThreads >= (DWORD)MinLimitTotalCPThreads &&
+ MaxWorkerThreads != 0 &&
+ MaxIOCompletionThreads != 0)
{
BEGIN_SO_INTOLERANT_CODE(GetThread());