From: Joel Rosdahl Date: Wed, 23 Nov 2022 19:11:12 +0000 (+0100) Subject: fix: Don't use copy of mutex/condition in long-lived lock thread X-Git-Tag: v4.8~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=034e3316eb4e3b6a4508f34bde2b1049c681542c;p=thirdparty%2Fccache.git fix: Don't use copy of mutex/condition in long-lived lock thread This was kind of due to a typo in 0babd33e84147e923a729ee07a3b85097ec8baa8. Since the LongLivedLockFile class is not used yet, the bug does not affect any released code. --- diff --git a/src/util/LockFile.cpp b/src/util/LockFile.cpp index 4848eb64d..4636e68e5 100644 --- a/src/util/LockFile.cpp +++ b/src/util/LockFile.cpp @@ -366,7 +366,7 @@ LongLivedLockFile::on_after_acquire() } LOG_RAW("Starting keep-alive thread"); - m_keep_alive_thread = std::thread([=] { + m_keep_alive_thread = std::thread([&] { while (true) { std::unique_lock lock(m_stop_keep_alive_mutex); m_stop_keep_alive_condition.wait_for(