MXS-1848 Rename monitorDestroy to monitor_deactivate

MonitorDestroy() (renamed to monitor_destroy()) will be used for
actually destroying the monitor instance, that is, execute
destroyInstance() on the loaded module instance and freeing the
the monitor instance.

TODO: monitor_deactivate() could do all the stuff which is currently
      done to the monitor in config_runtime(), instead of just
      turning off the flag.
This commit is contained in:
Johan Wikman
2018-05-05 16:07:31 +03:00
parent 60228f0f26
commit 83f3d6d71d
3 changed files with 13 additions and 3 deletions

View File

@ -992,7 +992,7 @@ bool runtime_destroy_monitor(MXS_MONITOR *monitor)
{ {
monitorRemoveServer(monitor, monitor->monitored_servers->server); monitorRemoveServer(monitor, monitor->monitored_servers->server);
} }
monitorDestroy(monitor); monitor_deactivate(monitor);
MXS_NOTICE("Destroyed monitor '%s'", monitor->name); MXS_NOTICE("Destroyed monitor '%s'", monitor->name);
} }

View File

@ -52,7 +52,17 @@ void monitor_free(MXS_MONITOR *);
void monitorStart(MXS_MONITOR *, const MXS_CONFIG_PARAMETER*); void monitorStart(MXS_MONITOR *, const MXS_CONFIG_PARAMETER*);
void monitorStop(MXS_MONITOR *); void monitorStop(MXS_MONITOR *);
void monitorDestroy(MXS_MONITOR* monitor);
/**
* @brief Mark monitor as deactivated
*
* A deactivated monitor appears not to exist, as if it had been
* destroyed.
*
* @param monitor
*/
void monitor_deactivate(MXS_MONITOR* monitor);
void monitorStopAll(); void monitorStopAll();
void monitorStartAll(); void monitorStartAll();

View File

@ -270,7 +270,7 @@ monitorStop(MXS_MONITOR *monitor)
} }
} }
void monitorDestroy(MXS_MONITOR* monitor) void monitor_deactivate(MXS_MONITOR* monitor)
{ {
spinlock_acquire(&monLock); spinlock_acquire(&monLock);
monitor->active = false; monitor->active = false;