]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: cache: Use the new _HA_ATOMIC_* macros.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 8 Mar 2019 17:49:24 +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/cache.c

index fddff72c312e95f105fe8783d74f40de10987971..e0b904be6ec42f18f42cd51b94ee7a273eccd972 100644 (file)
@@ -1431,9 +1431,9 @@ enum act_return http_action_req_cache_use(struct act_rule *rule, struct proxy *p
                return ACT_RET_CONT;
 
        if (px == strm_fe(s))
-               HA_ATOMIC_ADD(&px->fe_counters.p.http.cache_lookups, 1);
+               _HA_ATOMIC_ADD(&px->fe_counters.p.http.cache_lookups, 1);
        else
-               HA_ATOMIC_ADD(&px->be_counters.p.http.cache_lookups, 1);
+               _HA_ATOMIC_ADD(&px->be_counters.p.http.cache_lookups, 1);
 
        shctx_lock(shctx_ptr(cache));
        res = entry_exist(cache, s->txn->cache_hash);
@@ -1450,9 +1450,9 @@ enum act_return http_action_req_cache_use(struct act_rule *rule, struct proxy *p
                        appctx->ctx.cache.sent = 0;
 
                        if (px == strm_fe(s))
-                               HA_ATOMIC_ADD(&px->fe_counters.p.http.cache_hits, 1);
+                               _HA_ATOMIC_ADD(&px->fe_counters.p.http.cache_hits, 1);
                        else
-                               HA_ATOMIC_ADD(&px->be_counters.p.http.cache_hits, 1);
+                               _HA_ATOMIC_ADD(&px->be_counters.p.http.cache_hits, 1);
                        return ACT_RET_CONT;
                } else {
                        shctx_lock(shctx_ptr(cache));