Skip to content

Commit 8bab650

Browse files
committed
Thread/ThreadPool: Fix minimum numberThreads
1 parent 36e16ed commit 8bab650

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

modules/Thread/ThreadPool.mpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export namespace CppUtils::Thread
1515

1616
public:
1717
explicit inline ThreadPool(
18-
std::size_t numberThreads = std::thread::hardware_concurrency(),
18+
std::size_t numberThreads = std::max(1uz, static_cast<std::size_t>(std::thread::hardware_concurrency())),
1919
std::function<void(std::exception_ptr)> onError = nullptr,
2020
std::function<void()> finally = nullptr):
2121
m_numberThreads{numberThreads},

0 commit comments

Comments
 (0)