]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: proxy: Use the new _HA_ATOMIC_* macros.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 8 Mar 2019 17:48:16 +0000 (18:48 +0100)
committerOlivier Houchard <cognet@ci0.org>
Mon, 11 Mar 2019 16:02:37 +0000 (17:02 +0100)
Use the new _HA_ATOMIC_* macros and add barriers where needed.

include/proto/proxy.h

index 7bd942109650d1da9758ca972a0fb1c2119b73bd..b509dff0fbc5e47742ea784ceb739ec552308a0e 100644 (file)
@@ -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));
 }