Skip to content
Snippets Groups Projects
Commit c1bd602e authored by Morph's avatar Morph
Browse files

common: Eliminate variable shadowing

GCC/Clang treats variables within lambdas as potentially shadowing those outside the lambda, despite them not being captured inside the lambda's capture list.
parent b3d6f7bd
No related branches found
No related tags found
No related merge requests found
...@@ -33,9 +33,9 @@ void DetachedTasks::AddTask(std::function<void()> task) { ...@@ -33,9 +33,9 @@ void DetachedTasks::AddTask(std::function<void()> task) {
++instance->count; ++instance->count;
std::thread([task{std::move(task)}]() { std::thread([task{std::move(task)}]() {
task(); task();
std::unique_lock lock{instance->mutex}; std::unique_lock thread_lock{instance->mutex};
--instance->count; --instance->count;
std::notify_all_at_thread_exit(instance->cv, std::move(lock)); std::notify_all_at_thread_exit(instance->cv, std::move(thread_lock));
}).detach(); }).detach();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment