]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: spawn replayer thread
authorMykola Golub <mgolub@mirantis.com>
Sun, 6 Mar 2016 14:12:03 +0000 (16:12 +0200)
committerMykola Golub <mgolub@mirantis.com>
Mon, 7 Mar 2016 13:05:04 +0000 (15:05 +0200)
Also, wait for it to finish only if it has been started.

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/tools/rbd_mirror/Replayer.cc

index c89944fd19e315a730b62862301ebd8e94ec77e3..ba2c4f680f2d55c3162efdf60fec0f9f28ec1f2a 100644 (file)
@@ -37,7 +37,9 @@ Replayer::~Replayer()
     Mutex::Locker l(m_lock);
     m_cond.Signal();
   }
-  m_replayer_thread.join();
+  if (m_replayer_thread.is_started()) {
+    m_replayer_thread.join();
+  }
 }
 
 int Replayer::init()
@@ -81,6 +83,8 @@ int Replayer::init()
   m_pool_watcher.reset(new PoolWatcher(m_remote, 30, m_lock, m_cond));
   m_pool_watcher->refresh_images();
 
+  m_replayer_thread.create("replayer");
+
   return 0;
 }