]> git.apps.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)
committerNathan Cutler <ncutler@suse.com>
Fri, 11 May 2018 20:04:33 +0000 (22:04 +0200)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit f3862d8849c014a4a863ebedc9719241ec9c2c46)

src/log/Log.cc

index 6af49b4c8cd56fd2a37ecb7f00b37fe215681193..5f7e23b4b048c0343972e53355463a864ea2a108 100644 (file)
@@ -433,13 +433,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()