diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-05-26 20:33:55 -0400 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-06-13 18:19:22 -0400 |
commit | c1bd602e4ce8db7b66e64c69d57fb3b8db8a8529 (patch) | |
tree | e6d7544381654e852da742a39004fdf17a79e775 /src/common/detached_tasks.cpp | |
parent | b3d6f7bdd841098aa47f367d60c2ac0ab320dd98 (diff) |
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.
Diffstat (limited to 'src/common/detached_tasks.cpp')
-rw-r--r-- | src/common/detached_tasks.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/detached_tasks.cpp b/src/common/detached_tasks.cpp index c1362631ee..ec31d0b889 100644 --- a/src/common/detached_tasks.cpp +++ b/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(); } |