Skip to content
Snippets Groups Projects
Commit b9c79a1d authored by Adrien Béraud's avatar Adrien Béraud
Browse files

thread pool: release tasks on stop

parent 2c7edb69
Branches
No related tags found
No related merge requests found
...@@ -106,6 +106,8 @@ ThreadPool::stop() ...@@ -106,6 +106,8 @@ ThreadPool::stop()
{ {
std::lock_guard<std::mutex> l(lock_); std::lock_guard<std::mutex> l(lock_);
running_ = false; running_ = false;
while (not tasks_.empty())
tasks_.pop();
cv_.notify_all(); cv_.notify_all();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment