MXS-2314 Remove unnecessary monitor state
This commit is contained in:
@ -81,9 +81,8 @@ enum monitor_capability_t
|
|||||||
// Monitor state enum
|
// Monitor state enum
|
||||||
enum monitor_state_t
|
enum monitor_state_t
|
||||||
{
|
{
|
||||||
|
MONITOR_STATE_STOPPED,
|
||||||
MONITOR_STATE_RUNNING,
|
MONITOR_STATE_RUNNING,
|
||||||
MONITOR_STATE_STOPPING,
|
|
||||||
MONITOR_STATE_STOPPED
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Return type of mon_ping_or_connect_to_db(). */
|
/* Return type of mon_ping_or_connect_to_db(). */
|
||||||
|
@ -320,7 +320,6 @@ void monitor_stop(Monitor* monitor)
|
|||||||
/** Only stop the monitor if it is running */
|
/** Only stop the monitor if it is running */
|
||||||
if (monitor->m_state == MONITOR_STATE_RUNNING)
|
if (monitor->m_state == MONITOR_STATE_RUNNING)
|
||||||
{
|
{
|
||||||
monitor->m_state = MONITOR_STATE_STOPPING;
|
|
||||||
monitor->stop();
|
monitor->stop();
|
||||||
monitor->m_state = MONITOR_STATE_STOPPED;
|
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:
|
case MONITOR_STATE_RUNNING:
|
||||||
return "Running";
|
return "Running";
|
||||||
|
|
||||||
case MONITOR_STATE_STOPPING:
|
|
||||||
return "Stopping";
|
|
||||||
|
|
||||||
case MONITOR_STATE_STOPPED:
|
case MONITOR_STATE_STOPPED:
|
||||||
return "Stopped";
|
return "Stopped";
|
||||||
|
|
||||||
@ -2489,7 +2485,7 @@ void MonitorWorker::do_stop()
|
|||||||
mxb_assert(mxs_rworker_get_current() == NULL
|
mxb_assert(mxs_rworker_get_current() == NULL
|
||||||
|| mxs_rworker_get_current() == mxs_rworker_get(MXS_RWORKER_MAIN));
|
|| mxs_rworker_get_current() == mxs_rworker_get(MXS_RWORKER_MAIN));
|
||||||
mxb_assert(Worker::state() != Worker::STOPPED);
|
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);
|
mxb_assert(m_thread_running.load() == true);
|
||||||
|
|
||||||
Worker::shutdown();
|
Worker::shutdown();
|
||||||
|
Reference in New Issue
Block a user