]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: xref: Use the new _HA_ATOMIC_* macros.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 8 Mar 2019 17:47:29 +0000 (18:47 +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/common/xref.h

index 48bc07a92f4cd7bec6e22e80a443a7e51aab84de..f7fe26d23601cfe091c922a0eee1c51ddae6781b 100644 (file)
@@ -31,7 +31,7 @@ static inline struct xref *xref_get_peer_and_lock(struct xref *xref)
        while (1) {
 
                /* Get the local pointer to the peer. */
-               local = HA_ATOMIC_XCHG(&xref->peer, XREF_BUSY);
+               local = _HA_ATOMIC_XCHG(&xref->peer, XREF_BUSY);
                __ha_barrier_atomic_store();
 
                /* If the local pointer is NULL, the peer no longer exists. */
@@ -49,7 +49,7 @@ static inline struct xref *xref_get_peer_and_lock(struct xref *xref)
                /* We are locked, the peer cant disapear, try to acquire
                 * the pper's lock. Note that remote can't be NULL.
                 */
-               remote = HA_ATOMIC_XCHG(&local->peer, XREF_BUSY);
+               remote = _HA_ATOMIC_XCHG(&local->peer, XREF_BUSY);
 
                /* The remote lock is BUSY, We retry the process. */
                if (remote == XREF_BUSY) {