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

src/session.c

index 58317b8972e59a6a45782401011f46a10b1c140c..ab49fb6fbdb2fa6327c8b91f237a5abab5e6de32 100644 (file)
@@ -55,8 +55,8 @@ struct session *session_new(struct proxy *fe, struct listener *li, enum obj_type
                vars_init(&sess->vars, SCOPE_SESS);
                sess->task = NULL;
                sess->t_handshake = -1; /* handshake not done yet */
-               HA_ATOMIC_ADD(&totalconn, 1);
-               HA_ATOMIC_ADD(&jobs, 1);
+               _HA_ATOMIC_ADD(&totalconn, 1);
+               _HA_ATOMIC_ADD(&jobs, 1);
                LIST_INIT(&sess->srv_list);
                sess->idle_conns = 0;
        }
@@ -97,7 +97,7 @@ void session_free(struct session *sess)
                pool_free(pool_head_sess_srv_list, srv_list);
        }
        pool_free(pool_head_session, sess);
-       HA_ATOMIC_SUB(&jobs, 1);
+       _HA_ATOMIC_SUB(&jobs, 1);
 }
 
 /* callback used from the connection/mux layer to notify that a connection is