MXS-2314 Remove unnecessary monitor state

This commit is contained in:
Johan Wikman 2019-02-08 17:15:39 +02:00
parent 72d02d33c0
commit 544e88a0b8
2 changed files with 2 additions and 7 deletions

View File

@ -81,9 +81,8 @@ enum monitor_capability_t
// Monitor state enum
enum monitor_state_t
{
MONITOR_STATE_STOPPED,
MONITOR_STATE_RUNNING,
MONITOR_STATE_STOPPING,
MONITOR_STATE_STOPPED
};
/* Return type of mon_ping_or_connect_to_db(). */

View File

@ -320,7 +320,6 @@ void monitor_stop(Monitor* monitor)
/** Only stop the monitor if it is running */
if (monitor->m_state == MONITOR_STATE_RUNNING)
{
monitor->m_state = MONITOR_STATE_STOPPING;
monitor->stop();
monitor->m_state = MONITOR_STATE_STOPPED;
}
@ -1612,9 +1611,6 @@ static const char* monitor_state_to_string(monitor_state_t state)
case MONITOR_STATE_RUNNING:
return "Running";
case MONITOR_STATE_STOPPING:
return "Stopping";
case MONITOR_STATE_STOPPED:
return "Stopped";
@ -2489,7 +2485,7 @@ void MonitorWorker::do_stop()
mxb_assert(mxs_rworker_get_current() == NULL
|| mxs_rworker_get_current() == mxs_rworker_get(MXS_RWORKER_MAIN));
mxb_assert(Worker::state() != Worker::STOPPED);
mxb_assert(monitor_state() == MONITOR_STATE_STOPPING);
mxb_assert(monitor_state() != MONITOR_STATE_STOPPED);
mxb_assert(m_thread_running.load() == true);
Worker::shutdown();