We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36e16ed commit 8bab650Copy full SHA for 8bab650
1 file changed
modules/Thread/ThreadPool.mpp
@@ -15,7 +15,7 @@ export namespace CppUtils::Thread
15
16
public:
17
explicit inline ThreadPool(
18
- std::size_t numberThreads = std::thread::hardware_concurrency(),
+ std::size_t numberThreads = std::max(1uz, static_cast<std::size_t>(std::thread::hardware_concurrency())),
19
std::function<void(std::exception_ptr)> onError = nullptr,
20
std::function<void()> finally = nullptr):
21
m_numberThreads{numberThreads},
0 commit comments