Client::~Client()
{
+ assert(!client_lock.is_locked());
+
tear_down_cache();
if (objectcacher) {
{
Mutex::Locker lock(client_lock);
+ objectcacher->start();
+
// ok!
messenger->add_dispatcher_head(this);
void Client::shutdown()
{
dout(1) << "shutdown" << dendl;
+
+ objectcacher->stop(); // outside of client_lock! this does a join.
+
+ client_lock.Lock();
objecter->shutdown();
+ client_lock.Unlock();
monclient->shutdown();
messenger->shutdown();
}
flusher_stop(false), flusher_thread(this),
stat_waiter(0),
stat_clean(0), stat_dirty(0), stat_rx(0), stat_tx(0), stat_missing(0) {
- flusher_thread.create();
}
~ObjectCacher() {
// we should be empty.
assert(lru_rest.lru_get_size() == 0);
assert(lru_dirty.lru_get_size() == 0);
assert(dirty_bh.empty());
-
+ }
+
+ void start() {
+ flusher_thread.create();
+ }
+ void stop() {
assert(flusher_thread.is_started());
lock.Lock(); // hmm.. watch out for deadlock!
flusher_stop = true;