From: Olivier Houchard Date: Fri, 8 Mar 2019 17:47:29 +0000 (+0100) Subject: MEDIUM: xref: Use the new _HA_ATOMIC_* macros. X-Git-Tag: v2.0-dev2~97 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8beb27e9ceb64940c827b43d447f3de6c0db3617;p=thirdparty%2Fhaproxy.git MEDIUM: xref: Use the new _HA_ATOMIC_* macros. Use the new _HA_ATOMIC_* macros and add barriers where needed. --- diff --git a/include/common/xref.h b/include/common/xref.h index 48bc07a92f..f7fe26d236 100644 --- a/include/common/xref.h +++ b/include/common/xref.h @@ -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) {