]> 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>
Thu, 4 Jun 2015 20:49:51 +0000 (16:49 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
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)