MXS-1775 Monitor stopping moved to maxscale::MonitorInstance

This commit is contained in:
Johan Wikman
2018-05-16 11:20:50 +03:00
parent 1304fd6147
commit bcb7d09a15
12 changed files with 15 additions and 85 deletions

View File

@ -27,6 +27,8 @@ public:
virtual ~MonitorInstance();
void stop();
protected:
MonitorInstance(MXS_MONITOR* pMonitor);

View File

@ -2522,6 +2522,19 @@ MonitorInstance::~MonitorInstance()
ss_dassert(!m_script);
}
void MonitorInstance::stop()
{
ss_dassert(m_thread);
atomic_store_int32(&m_shutdown, 1);
thread_wait(m_thread);
m_thread = 0;
m_shutdown = 0;
MXS_FREE(m_script);
m_script = NULL;
}
//static
void MonitorInstance::main(void* pArg)
{

View File

@ -219,24 +219,6 @@ bool AuroraMonitor::start(const MXS_CONFIG_PARAMETER *params)
return started;
}
/**
* Stop a running monitor
*
* @param arg Handle on thr running monior
*/
void AuroraMonitor::stop()
{
ss_dassert(m_thread);
m_shutdown = true;
thread_wait(m_thread);
m_thread = 0;
m_shutdown = false;
MXS_FREE(m_script);
m_script = NULL;
}
/**
* Diagnostic interface
*

View File

@ -29,7 +29,6 @@ public:
static AuroraMonitor* create(MXS_MONITOR* monitor);
void destroy();
bool start(const MXS_CONFIG_PARAMETER* param);
void stop();
void diagnostics(DCB* dcb) const;
json_t* diagnostics_json() const;

View File

@ -202,24 +202,6 @@ bool GaleraMonitor::start(const MXS_CONFIG_PARAMETER *params)
return started;
}
/**
* Stop a running monitor
*
* @param arg Handle on thr running monior
*/
void GaleraMonitor::stop()
{
ss_dassert(m_thread);
m_shutdown = true;
thread_wait(m_thread);
m_thread = 0;
m_shutdown = false;
MXS_FREE(m_script);
m_script = NULL;
}
/**
* Diagnostic interface
*

View File

@ -61,7 +61,6 @@ public:
static GaleraMonitor* create(MXS_MONITOR* monitor);
void destroy();
bool start(const MXS_CONFIG_PARAMETER* param);
void stop();
void diagnostics(DCB* dcb) const;
json_t* diagnostics_json() const;

View File

@ -65,16 +65,6 @@ bool GRMon::start(const MXS_CONFIG_PARAMETER* params)
return started;
}
void GRMon::stop()
{
ss_dassert(m_thread);
atomic_store_int32(&m_shutdown, 1);
thread_wait(m_thread);
m_thread = 0;
m_shutdown = 0;
}
void GRMon::diagnostics(DCB* dcb) const
{
}

View File

@ -29,7 +29,6 @@ public:
static GRMon* create(MXS_MONITOR* monitor);
void destroy();
bool start(const MXS_CONFIG_PARAMETER* params);
void stop();
void diagnostics(DCB* dcb) const;
json_t* diagnostics_json() const;

View File

@ -154,22 +154,6 @@ bool MMMonitor::start(const MXS_CONFIG_PARAMETER *params)
return started;
}
/**
* Stop a running monitor
*
* @param arg Handle on thr running monior
*/
void MMMonitor::stop()
{
m_shutdown = 1;
thread_wait(m_thread);
m_thread = 0;
m_shutdown = 0;
MXS_FREE(m_script);
m_script = NULL;
}
/**
* Diagnostic interface
*

View File

@ -29,7 +29,6 @@ public:
static MMMonitor* create(MXS_MONITOR* monitor);
void destroy();
bool start(const MXS_CONFIG_PARAMETER* param);
void stop();
void diagnostics(DCB* dcb) const;
json_t* diagnostics_json() const;

View File

@ -137,24 +137,6 @@ bool NDBCMonitor::start(const MXS_CONFIG_PARAMETER *params)
return started;
}
/**
* Stop a running monitor
*
* @param arg Handle on thr running monior
*/
void NDBCMonitor::stop()
{
ss_dassert(m_thread);
m_shutdown = 1;
thread_wait(m_thread);
m_thread = 0;
m_shutdown = 0;
MXS_FREE(m_script);
m_script = NULL;
}
/**
* Diagnostic interface
*

View File

@ -29,7 +29,6 @@ public:
static NDBCMonitor* create(MXS_MONITOR* monitor);
void destroy();
bool start(const MXS_CONFIG_PARAMETER* param);
void stop();
void diagnostics(DCB* dcb) const;
json_t* diagnostics_json() const;