]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: server: Use the new _HA_ATOMIC_* macros.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 8 Mar 2019 17:48:31 +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/server.h

index 45947cb9ceaa66dd01e0741c98b52cd8b9d044cc..cc6a699a86a2e9322437e9ef1309d82552ad3950 100644 (file)
@@ -71,7 +71,7 @@ struct task *srv_cleanup_toremove_connections(struct task *task, void *context,
 /* increase the number of cumulated connections on the designated server */
 static void inline srv_inc_sess_ctr(struct server *s)
 {
-       HA_ATOMIC_ADD(&s->counters.cum_sess, 1);
+       _HA_ATOMIC_ADD(&s->counters.cum_sess, 1);
        HA_ATOMIC_UPDATE_MAX(&s->counters.sps_max,
                             update_freq_ctr(&s->sess_per_sec, 1));
 }
@@ -254,9 +254,9 @@ static inline int srv_add_to_idle_list(struct server *srv, struct connection *co
            !conn->mux->used_streams(conn) && conn->mux->avail_streams(conn)) {
                int retadd;
 
-               retadd = HA_ATOMIC_ADD(&srv->curr_idle_conns, 1);
+               retadd = _HA_ATOMIC_ADD(&srv->curr_idle_conns, 1);
                if (retadd >= srv->max_idle_conns) {
-                       HA_ATOMIC_SUB(&srv->curr_idle_conns, 1);
+                       _HA_ATOMIC_SUB(&srv->curr_idle_conns, 1);
                        return 0;
                }
                LIST_DEL(&conn->list);