From: Olivier Houchard Date: Fri, 8 Mar 2019 17:54:34 +0000 (+0100) Subject: MEDIUM: sessions: Use the new _HA_ATOMIC_* macros. X-Git-Tag: v2.0-dev2~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5b3d30b60ad26128e5cd09fac3e0cbd12ced28d;p=thirdparty%2Fhaproxy.git MEDIUM: sessions: Use the new _HA_ATOMIC_* macros. Use the new _HA_ATOMIC_* macros and add barriers where needed. --- diff --git a/src/session.c b/src/session.c index 58317b8972..ab49fb6fbd 100644 --- a/src/session.c +++ b/src/session.c @@ -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