command_tp(cct, "OSD::command_tp", "tp_osd_cmd", 1),
session_waiting_lock("OSD::session_waiting_lock"),
heartbeat_lock("OSD::heartbeat_lock"),
- heartbeat_stop(false), heartbeat_update_lock("OSD::heartbeat_update_lock"),
+ heartbeat_stop(false),
heartbeat_need_update(true),
hbclient_messenger(hb_clientm),
hb_front_server_messenger(hb_front_serverm),
map<int, int> debug_heartbeat_drops_remaining;
Cond heartbeat_cond;
bool heartbeat_stop;
- Mutex heartbeat_update_lock; // orders under heartbeat_lock
- bool heartbeat_need_update; ///< true if we need to refresh our heartbeat peers
+ std::atomic_bool heartbeat_need_update;
map<int,HeartbeatInfo> heartbeat_peers; ///< map of osd id to HeartbeatInfo
utime_t last_mon_heartbeat;
Messenger *hbclient_messenger;
void maybe_update_heartbeat_peers();
void reset_heartbeat_peers();
bool heartbeat_peers_need_update() {
- Mutex::Locker l(heartbeat_update_lock);
- return heartbeat_need_update;
+ return heartbeat_need_update.load();
}
void heartbeat_set_peers_need_update() {
- Mutex::Locker l(heartbeat_update_lock);
- heartbeat_need_update = true;
+ heartbeat_need_update.store(true);
}
void heartbeat_clear_peers_need_update() {
- Mutex::Locker l(heartbeat_update_lock);
- heartbeat_need_update = false;
+ heartbeat_need_update.store(false);
}
void heartbeat();
void heartbeat_check();