]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Don't use copy of mutex/condition in long-lived lock thread
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 23 Nov 2022 19:11:12 +0000 (20:11 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 13 Dec 2022 19:36:55 +0000 (20:36 +0100)
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.

src/util/LockFile.cpp

index 4848eb64d9c675ec23ca2bcf5321f27a2b69f46b..4636e68e507e0700db47cee51d1fb4170e25014d 100644 (file)
@@ -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<std::mutex> lock(m_stop_keep_alive_mutex);
       m_stop_keep_alive_condition.wait_for(