From: Olivier Houchard Date: Fri, 8 Mar 2019 17:48:16 +0000 (+0100) Subject: MEDIUM: proxy: Use the new _HA_ATOMIC_* macros. X-Git-Tag: v2.0-dev2~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11ecfd1c01b4b07ec14e9efa72b0cdbdb7f0d1b8;p=thirdparty%2Fhaproxy.git MEDIUM: proxy: Use the new _HA_ATOMIC_* macros. Use the new _HA_ATOMIC_* macros and add barriers where needed. --- diff --git a/include/proto/proxy.h b/include/proto/proxy.h index 7bd9421096..b509dff0fb 100644 --- a/include/proto/proxy.h +++ b/include/proto/proxy.h @@ -121,9 +121,9 @@ static inline void proxy_reset_timeouts(struct proxy *proxy) /* increase the number of cumulated connections received on the designated frontend */ static void inline proxy_inc_fe_conn_ctr(struct listener *l, struct proxy *fe) { - HA_ATOMIC_ADD(&fe->fe_counters.cum_conn, 1); + _HA_ATOMIC_ADD(&fe->fe_counters.cum_conn, 1); if (l->counters) - HA_ATOMIC_ADD(&l->counters->cum_conn, 1); + _HA_ATOMIC_ADD(&l->counters->cum_conn, 1); HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.cps_max, update_freq_ctr(&fe->fe_conn_per_sec, 1)); } @@ -132,9 +132,9 @@ static void inline proxy_inc_fe_conn_ctr(struct listener *l, struct proxy *fe) static void inline proxy_inc_fe_sess_ctr(struct listener *l, struct proxy *fe) { - HA_ATOMIC_ADD(&fe->fe_counters.cum_sess, 1); + _HA_ATOMIC_ADD(&fe->fe_counters.cum_sess, 1); if (l->counters) - HA_ATOMIC_ADD(&l->counters->cum_sess, 1); + _HA_ATOMIC_ADD(&l->counters->cum_sess, 1); HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.sps_max, update_freq_ctr(&fe->fe_sess_per_sec, 1)); } @@ -142,7 +142,7 @@ static void inline proxy_inc_fe_sess_ctr(struct listener *l, struct proxy *fe) /* increase the number of cumulated connections on the designated backend */ static void inline proxy_inc_be_ctr(struct proxy *be) { - HA_ATOMIC_ADD(&be->be_counters.cum_conn, 1); + _HA_ATOMIC_ADD(&be->be_counters.cum_conn, 1); HA_ATOMIC_UPDATE_MAX(&be->be_counters.sps_max, update_freq_ctr(&be->be_sess_per_sec, 1)); } @@ -150,7 +150,7 @@ static void inline proxy_inc_be_ctr(struct proxy *be) /* increase the number of cumulated requests on the designated frontend */ static void inline proxy_inc_fe_req_ctr(struct proxy *fe) { - HA_ATOMIC_ADD(&fe->fe_counters.p.http.cum_req, 1); + _HA_ATOMIC_ADD(&fe->fe_counters.p.http.cum_req, 1); HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.p.http.rps_max, update_freq_ctr(&fe->fe_req_per_sec, 1)); }