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 | 716cced39900d225aedaf9520eca002b25b8dd6f (patch) | |
| tree | e6d7544381654e852da742a39004fdf17a79e775 /src/common/detached_tasks.cpp | |
| parent | 911eae6283784db18b8de9edd5cb28a45798d614 (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(); } |
