Destroy monitor only if it's not used

If a service uses a monitor as the source of its servers, it must not be
destroyed before the monitor is removed from all services that use it.
This commit is contained in:
Markus Mäkelä
2019-04-01 10:46:33 +03:00
parent 84bf241dd1
commit 1417292f0d
3 changed files with 43 additions and 10 deletions

View File

@ -347,6 +347,15 @@ bool service_port_is_used(int port);
*/
bool service_has_named_listener(Service* service, const char* name);
/**
* See if a monitor is used by any service
*
* @param monitor Monitor to look for
*
* @return The first service that uses the monitor or nullptr if no service uses it
*/
Service* service_uses_monitor(mxs::Monitor* monitor);
// Required by MaxAdmin
int service_enable_root(Service* service, int action);