return false;
}
-void MgrClient::send_stats()
+void MgrClient::_send_stats()
{
- send_report();
- send_pgstats();
+ _send_report();
+ _send_pgstats();
if (stats_period != 0) {
- report_callback = new FunctionContext([this](int){send_stats();});
- timer.add_event_after(stats_period, report_callback);
+ report_callback = timer.add_event_after(
+ stats_period,
+ new FunctionContext([this](int) {
+ _send_stats();
+ }));
}
}
-void MgrClient::send_report()
+void MgrClient::_send_report()
{
assert(lock.is_locked_by_me());
assert(session);
}
void MgrClient::send_pgstats()
+{
+ Mutex::Locker l(lock);
+ _send_pgstats();
+}
+
+void MgrClient::_send_pgstats()
{
if (pgstats_cb && session) {
session->con->send_message(pgstats_cb());
bool starting = (stats_period == 0) && (m->stats_period != 0);
stats_period = m->stats_period;
if (starting) {
- send_stats();
+ _send_stats();
}
m->put();