MXS-1775 Move thread main function to maxscale::MonitorInstance

This commit is contained in:
Johan Wikman
2018-05-16 11:09:11 +03:00
parent 3c277f4e5e
commit 1304fd6147
12 changed files with 15 additions and 39 deletions

View File

@ -139,7 +139,7 @@ bool MMMonitor::start(const MXS_CONFIG_PARAMETER *params)
m_script = config_copy_string(params, "script");
m_events = config_get_enum(params, "events", mxs_monitor_event_enum_values);
if (thread_start(&m_thread, MMMonitor::main, this, 0) == NULL)
if (thread_start(&m_thread, &maxscale::MonitorInstance::main, this, 0) == NULL)
{
MXS_ERROR("Failed to start monitor thread for monitor '%s'.", m_monitor->name);
MXS_FREE(m_script);
@ -492,11 +492,6 @@ monitorDatabase(MXS_MONITOR* mon, MXS_MONITORED_SERVER *database)
*
* @param arg The handle of the monitor
*/
void MMMonitor::main(void* arg)
{
static_cast<MMMonitor*>(arg)->main();
}
void MMMonitor::main()
{
MXS_MONITOR* mon = m_monitor;

View File

@ -44,5 +44,4 @@ private:
MXS_MONITORED_SERVER *get_current_master();
void main();
static void main(void* data);
};