diff --git a/server/core/internal/server.hh b/server/core/internal/server.hh index 2d57028c1..9f57719f0 100644 --- a/server/core/internal/server.hh +++ b/server/core/internal/server.hh @@ -33,34 +33,33 @@ class Server : public SERVER public: Server() - : response_time(maxbase::EMAverage {0.04, 0.35, 500}) + : m_response_time(maxbase::EMAverage {0.04, 0.35, 500}) { } int response_time_num_samples() const { - return response_time->num_samples(); + return m_response_time->num_samples(); } double response_time_average() const { - return response_time->average(); + return m_response_time->average(); } void response_time_add(double ave, int num_samples) { - response_time->add(ave, num_samples); + m_response_time->add(ave, num_samples); } - // TODO: Do all access to Server via methods - mutable std::mutex lock; + mutable std::mutex m_lock; private: // nantti, TODO. Decide whether to expose some of this in config, or if the values // can be calculated at runtime. The "500" or sample_max affects how often a // session should updates this stat. sample_max should be slightly lower than max sample // rate (which is less than qps due to the noise filter). - mxs::rworker_local response_time; + mxs::rworker_local m_response_time; }; void server_free(Server* server); diff --git a/server/core/server.cc b/server/core/server.cc index d91732c22..6062c1a8e 100644 --- a/server/core/server.cc +++ b/server/core/server.cc @@ -877,7 +877,7 @@ bool server_remove_parameter(SERVER* srv, const char* name) { Server* server = static_cast(srv); bool rval = false; - std::lock_guard guard(server->lock); + std::lock_guard guard(server->m_lock); for (SERVER_PARAM* p = server->parameters; p; p = p->next) { @@ -899,7 +899,7 @@ void server_set_parameter(SERVER* srv, const char* name, const char* value) if (param) { - std::lock_guard guard(server->lock); + std::lock_guard guard(server->m_lock); // Insert new value param->next = server->parameters; @@ -971,7 +971,7 @@ static size_t server_get_parameter_nolock(const SERVER* server, const char* name size_t server_get_parameter(const SERVER* srv, const char* name, char* out, size_t size) { const Server* server = static_cast(srv); - std::lock_guard guard(server->lock); + std::lock_guard guard(server->m_lock); return server_get_parameter_nolock(server, name, out, size); } @@ -1279,7 +1279,7 @@ bool mxs::server_set_status(SERVER* srv, int bit, string* errmsg_out) * but the race condition cannot cause significant harm. Monitors are never * freed so the pointer stays valid. */ MXS_MONITOR* mon = monitor_server_in_use(server); - std::lock_guard guard(server->lock); + std::lock_guard guard(server->m_lock); if (mon && mon->state == MONITOR_STATE_RUNNING) { @@ -1328,7 +1328,7 @@ bool mxs::server_clear_status(SERVER* srv, int bit, string* errmsg_out) Server* server = static_cast(srv); bool written = false; MXS_MONITOR* mon = monitor_server_in_use(server); - std::lock_guard guard(server->lock); + std::lock_guard guard(server->m_lock); if (mon && mon->state == MONITOR_STATE_RUNNING) {