Skip to content

Commit

Permalink
Limit min threads in thread pool to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
kouvel committed Nov 4, 2017
1 parent 8ef735c commit 8986b57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vm/win32threadpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 8986b57

Please sign in to comment.