void MonClient::init()
{
dout(10) << "init" << dendl;
+ timer.reset(new SafeTimer(monc_lock));
messenger->add_dispatcher_head(this);
entity_name = *g_conf.entity_name;
void MonClient::shutdown()
{
- timer.cancel_all_events();
+ timer->cancel_all_events();
}
int MonClient::authenticate(double timeout)
void MonClient::schedule_tick()
{
if (hunting)
- timer.add_event_after(g_conf.mon_client_hunt_interval, new C_Tick(this));
+ timer->add_event_after(g_conf.mon_client_hunt_interval, new C_Tick(this));
else
- timer.add_event_after(g_conf.mon_client_ping_interval, new C_Tick(this));
+ timer->add_event_after(g_conf.mon_client_ping_interval, new C_Tick(this));
}
#include "messages/MMonSubscribe.h"
+#include <memory>
+
class MonMap;
class MMonMap;
class MMonSubscribeAck;
entity_addr_t my_addr;
Mutex monc_lock;
- SafeTimer timer;
+ std::auto_ptr < SafeTimer > timer;
set<__u32> auth_supported;
state(MC_STATE_NONE),
messenger(NULL),
monc_lock("MonClient::monc_lock"),
- timer(monc_lock),
hunting(true),
want_monmap(true),
want_keys(0), global_id(0),
rotating_secrets(rkeys) { }
~MonClient() {
- timer.shutdown();
}
void init();