MEDIUM: cache: Use the new _HA_ATOMIC_* macros.

Use the new _HA_ATOMIC_* macros and add barriers where needed.
This commit is contained in:
Olivier Houchard 2019-03-08 18:49:24 +01:00 committed by Olivier Houchard
parent 237f781f2d
commit aa090d46fe

View 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));