From a49d7450da35e473a10a8a9f82958731eccec83f Mon Sep 17 00:00:00 2001 From: David Zafman Date: Tue, 21 Oct 2014 00:52:37 -0700 Subject: [PATCH] objecter: Unlock in shutdown before waiting for timer thread Fixes: #9845 Reviewed-by: Sage Weil Signed-off-by: David Zafman --- src/osdc/Objecter.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index d1d1665e07fdb..035127acc99ce 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -292,7 +292,7 @@ void Objecter::shutdown() { assert(initialized.read()); - RWLock::WLocker wl(rwlock); + rwlock.get_write(); initialized.set(0); @@ -392,6 +392,9 @@ void Objecter::shutdown() logger = NULL; } + // Let go of Objecter write lock so timer thread can shutdown + rwlock.unlock(); + { Mutex::Locker l(timer_lock); timer.shutdown(); @@ -1543,15 +1546,15 @@ void Objecter::tick() ldout(cct, 10) << "tick" << dendl; - // we are only called by C_Tick - assert(tick_event); - tick_event = NULL; - if (!initialized.read()) { // we raced with shutdown return; } + // we are only called by C_Tick + assert(tick_event); + tick_event = NULL; + set toping; int r = 0; -- 2.39.5