mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-05-16 14:48:03 +00:00
MEDIUM: cache: Use the new _HA_ATOMIC_* macros.
Use the new _HA_ATOMIC_* macros and add barriers where needed.
This commit is contained in:
parent
237f781f2d
commit
aa090d46fe
@ -1431,9 +1431,9 @@ enum act_return http_action_req_cache_use(struct act_rule *rule, struct proxy *p
|
|||||||
return ACT_RET_CONT;
|
return ACT_RET_CONT;
|
||||||
|
|
||||||
if (px == strm_fe(s))
|
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
|
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));
|
shctx_lock(shctx_ptr(cache));
|
||||||
res = entry_exist(cache, s->txn->cache_hash);
|
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;
|
appctx->ctx.cache.sent = 0;
|
||||||
|
|
||||||
if (px == strm_fe(s))
|
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
|
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;
|
return ACT_RET_CONT;
|
||||||
} else {
|
} else {
|
||||||
shctx_lock(shctx_ptr(cache));
|
shctx_lock(shctx_ptr(cache));
|
||||||
|
Loading…
Reference in New Issue
Block a user