From 06d362765ccf4b253ea3071798a454158108a0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 21 Dec 2016 21:53:10 +0200 Subject: [PATCH] Use pending status only with running monitors If a monitor is stopped, it is OK to modify the state of the server without putting it into the pending status variable. --- server/core/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/core/server.c b/server/core/server.c index 32e2faf67..9441d6d64 100644 --- a/server/core/server.c +++ b/server/core/server.c @@ -1313,7 +1313,7 @@ void server_set_status(SERVER *server, int bit) */ MONITOR *mon = monitor_server_in_use(server); spinlock_acquire(&server->lock); - if (mon) + if (mon && mon->state == MONITOR_STATE_RUNNING) { /* Set a pending status bit. It will be activated on the next monitor * loop. Also set a flag so the next loop happens sooner. @@ -1340,7 +1340,7 @@ void server_clear_status(SERVER *server, int bit) { MONITOR *mon = monitor_server_in_use(server); spinlock_acquire(&server->lock); - if (mon) + if (mon && mon->state == MONITOR_STATE_RUNNING) { /* Clear a pending status bit. It will be activated on the next monitor * loop. Also set a flag so the next loop happens sooner.