Explorar o código

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.
Morph %!s(int64=4) %!d(string=hai) anos
pai
achega
c1bd602e4c
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/common/detached_tasks.cpp

+ 2 - 2
src/common/detached_tasks.cpp

@@ -33,9 +33,9 @@ void DetachedTasks::AddTask(std::function<void()> task) {
     ++instance->count;
     std::thread([task{std::move(task)}]() {
         task();
-        std::unique_lock lock{instance->mutex};
+        std::unique_lock thread_lock{instance->mutex};
         --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();
 }