diff --git a/src/thread_pool.cpp b/src/thread_pool.cpp index d913ce78d55daf11fa5859749926ef2a97e76a82..1b727690366b773385ae24998e17804b70dd6040 100644 --- a/src/thread_pool.cpp +++ b/src/thread_pool.cpp @@ -32,7 +32,7 @@ struct ThreadPool::ThreadState }; ThreadPool::ThreadPool() - : maxThreads_(std::thread::hardware_concurrency()) + : maxThreads_(std::max<size_t>(std::thread::hardware_concurrency(), 4)) { threads_.reserve(maxThreads_); }