summaryrefslogtreecommitdiffstats
path: root/src/libutil/ref.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/ref.h')
-rw-r--r--src/libutil/ref.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/ref.h b/src/libutil/ref.h
index 18e2c3903..1ad7d24a1 100644
--- a/src/libutil/ref.h
+++ b/src/libutil/ref.h
@@ -55,13 +55,13 @@ typedef struct ref_entry_s {
#ifdef HAVE_ATOMIC_BUILTINS
#define REF_RETAIN(obj) do { \
if ((obj) != NULL) { \
- __sync_add_and_fetch (&(obj)->ref.refcount, 1); \
+ __atomic_add_fetch (&(obj)->ref.refcount, 1, __ATOMIC_RELEASE); \
} \
} while (0)
#define REF_RELEASE(obj) do { \
if ((obj) != NULL) { \
- unsigned int _rc_priv = __sync_sub_and_fetch (&(obj)->ref.refcount, 1); \
+ unsigned int _rc_priv = __atomic_sub_fetch (&(obj)->ref.refcount, 1, __ATOMIC_ACQ_REL); \
if (_rc_priv == 0 && (obj)->ref.dtor) { \
(obj)->ref.dtor (obj); \
} \