From b4db4100e32a3859435a0215c9dc55534710f49f Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Mon, 29 Nov 2010 13:33:47 -0800 Subject: [PATCH] Timer: add some asserts to catch certain errors. --- src/common/Timer.cc | 3 +-- src/mds/MDS.cc | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/Timer.cc b/src/common/Timer.cc index 8aec0eb867881..7a3439e37f173 100644 --- a/src/common/Timer.cc +++ b/src/common/Timer.cc @@ -68,13 +68,12 @@ void SafeTimer::shutdown() { dout(10) << "shutdown" << dendl; if (thread) { + assert(lock.is_locked()); cancel_all_events(); stopping = true; cond.Signal(); lock.Unlock(); - thread->join(); - lock.Lock(); delete thread; thread = NULL; diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 4e851fe005064..d1f71ea4fbaec 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -1374,6 +1374,7 @@ void MDS::stopping_done() void MDS::suicide() { + assert(mds_lock.is_locked()); if (want_state == MDSMap::STATE_STOPPED) state = want_state; else -- 2.39.5