-
Notifications
You must be signed in to change notification settings - Fork 286
Closed
Description
thread-pool/BS_thread_pool.hpp
Line 100 in 9d43f5d
explicit thread_pool(const concurrency_t thread_count_ = std::thread::hardware_concurrency()) : thread_count(thread_count_ ? thread_count_ : std::thread::hardware_concurrency()), threads(std::make_unique<std::thread[]>(thread_count_ ? thread_count_ : std::thread::hardware_concurrency())) |
std::thread::hardware_concurrency()
may return 0. So when constructed as thread_pool()
, thread_count
may be initialised to 0. thread_count(thread_count_ > 1 ? thread_count_ : 1
may be safer.
Metadata
Metadata
Assignees
Labels
No labels