]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
log: allow stop() when not started
authorSage Weil <sage@redhat.com>
Wed, 28 Feb 2018 23:12:42 +0000 (17:12 -0600)
committerSage Weil <sage@redhat.com>
Sun, 4 Mar 2018 21:31:54 +0000 (15:31 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/log/Log.cc

index 70c69881060867e5a4d7cea1374b67964f6906ca..8aedf3e4abde9fa8f3678054c155d001065dc235 100644 (file)
@@ -440,13 +440,14 @@ void Log::start()
 
 void Log::stop()
 {
-  assert(is_started());
-  pthread_mutex_lock(&m_queue_mutex);
-  m_stop = true;
-  pthread_cond_signal(&m_cond_flusher);
-  pthread_cond_broadcast(&m_cond_loggers);
-  pthread_mutex_unlock(&m_queue_mutex);
-  join();
+  if (is_started()) {
+    pthread_mutex_lock(&m_queue_mutex);
+    m_stop = true;
+    pthread_cond_signal(&m_cond_flusher);
+    pthread_cond_broadcast(&m_cond_loggers);
+    pthread_mutex_unlock(&m_queue_mutex);
+    join();
+  }
 }
 
 void *Log::entry()