This commit is contained in:
2025-01-22 13:21:31 -06:00
parent 50898488f0
commit 262fccf9a6

View File

@ -100,15 +100,16 @@ void tasks::stop() {
stop_requested_ = true;
unique_mutex_lock lock(mutex_);
std::vector<std::unique_ptr<std::jthread>> threads;
std::swap(threads, task_threads_);
std::deque<scheduled_task> tasks;
std::swap(tasks, tasks_);
notify_.notify_all();
lock.unlock();
task_threads_.clear();
lock.lock();
tasks_.clear();
notify_.notify_all();
lock.unlock();
threads.clear();
tasks.clear();
}
void tasks::task_thread() {