Skip to content

Commit 3393a05

Browse files
committed
added optional ctor argument
Why not trying what the OS recommends?
1 parent 180241d commit 3393a05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ThreadPool.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class ThreadPool {
1616
public:
1717
// the constructor just launches some amount of workers
18-
ThreadPool(size_t threads_n) : stop(false)
18+
ThreadPool(size_t threads_n = std::thread::hardware_concurrency()) : stop(false)
1919
{
2020
this->workers.reserve(threads_n);
2121
for(; threads_n; --threads_n)

0 commit comments

Comments
 (0)