MEDIUM: compression: Use the new _HA_ATOMIC_* macros.
Use the new _HA_ATOMIC_* macros and add barriers where needed.
diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c
index 3c2ce36..6cad8e1 100644
--- a/src/flt_http_comp.c
+++ b/src/flt_http_comp.c
@@ -286,14 +286,14 @@
if (st->comp_ctx && st->comp_ctx->cur_lvl > 0) {
update_freq_ctr(&global.comp_bps_in, consumed);
- HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_in, consumed);
- HA_ATOMIC_ADD(&s->be->be_counters.comp_in, consumed);
+ _HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_in, consumed);
+ _HA_ATOMIC_ADD(&s->be->be_counters.comp_in, consumed);
update_freq_ctr(&global.comp_bps_out, to_forward);
- HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_out, to_forward);
- HA_ATOMIC_ADD(&s->be->be_counters.comp_out, to_forward);
+ _HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_out, to_forward);
+ _HA_ATOMIC_ADD(&s->be->be_counters.comp_out, to_forward);
} else {
- HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_byp, consumed);
- HA_ATOMIC_ADD(&s->be->be_counters.comp_byp, consumed);
+ _HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_byp, consumed);
+ _HA_ATOMIC_ADD(&s->be->be_counters.comp_byp, consumed);
}
return to_forward;
@@ -461,9 +461,9 @@
goto end;
if (strm_fe(s)->mode == PR_MODE_HTTP)
- HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.p.http.comp_rsp, 1);
+ _HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.p.http.comp_rsp, 1);
if ((s->flags & SF_BE_ASSIGNED) && (s->be->mode == PR_MODE_HTTP))
- HA_ATOMIC_ADD(&s->be->be_counters.p.http.comp_rsp, 1);
+ _HA_ATOMIC_ADD(&s->be->be_counters.p.http.comp_rsp, 1);
end:
return 1;
}
@@ -1265,11 +1265,11 @@
/* update input rate */
if (st->comp_ctx && st->comp_ctx->cur_lvl > 0) {
update_freq_ctr(&global.comp_bps_in, st->consumed);
- HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_in, st->consumed);
- HA_ATOMIC_ADD(&s->be->be_counters.comp_in, st->consumed);
+ _HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_in, st->consumed);
+ _HA_ATOMIC_ADD(&s->be->be_counters.comp_in, st->consumed);
} else {
- HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_byp, st->consumed);
- HA_ATOMIC_ADD(&s->be->be_counters.comp_byp, st->consumed);
+ _HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_byp, st->consumed);
+ _HA_ATOMIC_ADD(&s->be->be_counters.comp_byp, st->consumed);
}
/* copy the remaining data in the tmp buffer. */
@@ -1292,8 +1292,8 @@
if (st->comp_ctx && st->comp_ctx->cur_lvl > 0) {
update_freq_ctr(&global.comp_bps_out, to_forward);
- HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_out, to_forward);
- HA_ATOMIC_ADD(&s->be->be_counters.comp_out, to_forward);
+ _HA_ATOMIC_ADD(&strm_fe(s)->fe_counters.comp_out, to_forward);
+ _HA_ATOMIC_ADD(&s->be->be_counters.comp_out, to_forward);
}
return to_forward;