aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/iothreadpool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenhttp/iothreadpool.cpp')
-rw-r--r--zenhttp/iothreadpool.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/zenhttp/iothreadpool.cpp b/zenhttp/iothreadpool.cpp
index 4ed81d7a2..4f1a6642b 100644
--- a/zenhttp/iothreadpool.cpp
+++ b/zenhttp/iothreadpool.cpp
@@ -2,6 +2,8 @@
#include "iothreadpool.h"
+#include <zencore/except.h>
+
namespace zen {
WinIoThreadPool::WinIoThreadPool(int InThreadCount)
@@ -28,9 +30,14 @@ WinIoThreadPool::~WinIoThreadPool()
}
void
-WinIoThreadPool::CreateIocp(HANDLE IoHandle, PTP_WIN32_IO_CALLBACK Callback, void* Context)
+WinIoThreadPool::CreateIocp(HANDLE IoHandle, PTP_WIN32_IO_CALLBACK Callback, void* Context, std::error_code& ErrorCode)
{
m_ThreadPoolIo = CreateThreadpoolIo(IoHandle, Callback, Context, &m_CallbackEnvironment);
+
+ if (!m_ThreadPoolIo)
+ {
+ ErrorCode = MakeErrorCodeFromLastError();
+ }
}
} // namespace zen