]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
log: fix helgrind warnings regarding possible data race
authorJason Dillaman <dillaman@redhat.com>
Thu, 30 Apr 2015 17:38:29 +0000 (13:38 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 28 Jul 2015 20:34:22 +0000 (16:34 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit c1e14451775049bbd95bcb19a0b62ab5e2c0a7bb)

src/log/Log.cc

index 046774dfce83212898fbe337edfd6f12ad6bf934..a450953e71d6b4e6fd2307776f6d4ec8f607fb0a 100644 (file)
@@ -106,7 +106,11 @@ void Log::set_max_new(int n)
 
 void Log::set_max_recent(int n)
 {
+  pthread_mutex_lock(&m_flush_mutex);
+  m_flush_mutex_holder = pthread_self();
   m_max_recent = n;
+  m_flush_mutex_holder = 0;
+  pthread_mutex_unlock(&m_flush_mutex);
 }
 
 void Log::set_log_file(string fn)