]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: checks: Use the new _HA_ATOMIC_* macros.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 8 Mar 2019 17:49:32 +0000 (18:49 +0100)
committerOlivier Houchard <cognet@ci0.org>
Mon, 11 Mar 2019 16:02:38 +0000 (17:02 +0100)
Use the new _HA_ATOMIC_* macros and add barriers where needed.

src/checks.c

index 2359176429542d3e24ab284cca18ba105aca51dd..118ec6bf4430cd83d9ed6f7dc461d163291c4fd6 100644 (file)
@@ -252,7 +252,7 @@ static void set_server_check_status(struct check *check, short status, const cha
                if ((!(check->state & CHK_ST_AGENT) ||
                    (check->status >= HCHK_STATUS_L57DATA)) &&
                    (check->health > 0)) {
-                       HA_ATOMIC_ADD(&s->counters.failed_checks, 1);
+                       _HA_ATOMIC_ADD(&s->counters.failed_checks, 1);
                        report = 1;
                        check->health--;
                        if (check->health < check->rise)
@@ -420,7 +420,7 @@ void __health_adjust(struct server *s, short status)
                return;
        }
 
-       HA_ATOMIC_ADD(&s->consecutive_errors, 1);
+       _HA_ATOMIC_ADD(&s->consecutive_errors, 1);
 
        if (s->consecutive_errors < s->consecutive_errors_limit)
                return;
@@ -461,7 +461,7 @@ void __health_adjust(struct server *s, short status)
        }
 
        s->consecutive_errors = 0;
-       HA_ATOMIC_ADD(&s->counters.failed_hana, 1);
+       _HA_ATOMIC_ADD(&s->counters.failed_hana, 1);
 
        if (s->check.fastinter) {
                expire = tick_add(now_ms, MS_TO_TICKS(s->check.fastinter));