Add recycling of destroyed monitors

If a destroyed monitor is created again, it will be reused. This should
prevent excessive memory growth when the same monitor is created and
destroyed again.
This commit is contained in:
Markus Mäkelä
2017-08-03 09:13:20 +03:00
parent a3e9d5c327
commit 512c3c018d
6 changed files with 131 additions and 64 deletions

View File

@ -198,10 +198,10 @@ struct mxs_monitor
char *module_name; /**< Name of the monitor module */
void *handle; /**< Handle returned from startMonitor */
size_t interval; /**< The monitor interval */
bool created_online; /**< Whether this monitor was created at runtime */
volatile bool server_pending_changes;
/**< Are there any pending changes to a server?
* If yes, the next monitor loop starts early. */
bool active; /**< True if monitor is active */
struct mxs_monitor *next; /**< Next monitor in the linked list */
};