Shutdown all monitors when shutting down the gateway

This commit is contained in:
Mark Riddoch
2013-07-24 14:44:29 +02:00
parent 7cdffb26e6
commit 8482c560f7
4 changed files with 24 additions and 1 deletions

View File

@ -104,6 +104,24 @@ MONITOR *ptr;
free(mon);
}
/**
* Shutdown all running monitors
*/
void
monitorStopAll()
{
MONITOR *ptr;
spinlock_acquire(&monLock);
ptr = allMonitors;
while (ptr)
{
ptr->module->stopMonitor(ptr->handle);
ptr = ptr->next;
}
spinlock_release(&monLock);
}
/**
* Add a server to a monitor. Simply register the server that needs to be
* monitored to the running monitor module.