aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/iothreadpool.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-10-12 15:27:55 +0200
committerStefan Boberg <[email protected]>2023-10-12 15:27:55 +0200
commit83f4c7f9f564febbcc5895337e2cbc340d7da441 (patch)
treeff3514b444bc6943e2668f8f145bf1c9b00556fc /src/zenhttp/iothreadpool.cpp
parentChange default port to 8558 (diff)
parentUpdate README.md (diff)
downloadzen-83f4c7f9f564febbcc5895337e2cbc340d7da441.tar.xz
zen-83f4c7f9f564febbcc5895337e2cbc340d7da441.zip
Merge remote-tracking branch 'origin/main' into zs/default-port-change
Diffstat (limited to 'src/zenhttp/iothreadpool.cpp')
-rw-r--r--src/zenhttp/iothreadpool.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/zenhttp/iothreadpool.cpp b/src/zenhttp/iothreadpool.cpp
index 6087e69ec..da4b42e28 100644
--- a/src/zenhttp/iothreadpool.cpp
+++ b/src/zenhttp/iothreadpool.cpp
@@ -8,14 +8,19 @@
namespace zen {
-WinIoThreadPool::WinIoThreadPool(int InThreadCount)
+WinIoThreadPool::WinIoThreadPool(int InThreadCount, int InMaxThreadCount)
{
- // Thread pool setup
+ ZEN_ASSERT(InThreadCount);
+
+ if (InMaxThreadCount < InThreadCount)
+ {
+ InMaxThreadCount = InThreadCount;
+ }
m_ThreadPool = CreateThreadpool(NULL);
SetThreadpoolThreadMinimum(m_ThreadPool, InThreadCount);
- SetThreadpoolThreadMaximum(m_ThreadPool, InThreadCount * 2);
+ SetThreadpoolThreadMaximum(m_ThreadPool, InMaxThreadCount);
InitializeThreadpoolEnvironment(&m_CallbackEnvironment);