summaryrefslogtreecommitdiff
path: root/lib/worker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/worker.cpp')
-rw-r--r--lib/worker.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/worker.cpp b/lib/worker.cpp
index cf59f56..4f1352d 100644
--- a/lib/worker.cpp
+++ b/lib/worker.cpp
@@ -9,16 +9,13 @@ Worker Worker::instance;
Worker::Worker() : todoLen {0}
{
std::generate_n(std::back_inserter(threads), std::thread::hardware_concurrency(), [this]() {
- return std::thread {&Worker::worker, this};
+ return std::jthread {&Worker::worker, this};
});
}
Worker::~Worker()
{
todoLen.release(std::thread::hardware_concurrency());
- std::for_each(threads.begin(), threads.end(), [](auto & th) {
- th.join();
- });
}
void