MEDIUM: threads/server: Use the server lock to protect health check and cli concurrency
diff --git a/include/proto/checks.h b/include/proto/checks.h
index 98dca25..b0b8c7d 100644
--- a/include/proto/checks.h
+++ b/include/proto/checks.h
@@ -37,11 +37,15 @@
  */
 static inline void health_adjust(struct server *s, short status)
 {
+	SPIN_LOCK(SERVER_LOCK, &s->lock);
 	/* return now if observing nor health check is not enabled */
-	if (!s->observe || !s->check.task)
+	if (!s->observe || !s->check.task) {
+		SPIN_UNLOCK(SERVER_LOCK, &s->lock);
 		return;
+	}
 
-	return __health_adjust(s, status);
+	__health_adjust(s, status);
+	SPIN_UNLOCK(SERVER_LOCK, &s->lock);
 }
 
 const char *init_check(struct check *check, int type);