]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add explicit acquire/release semantics to atomic_exchange_and_add.
authorMaxim Kuvyrkov <maxim@codesourcery.com>
Tue, 14 Aug 2012 02:31:00 +0000 (19:31 -0700)
committerMaxim Kuvyrkov <maxim@codesourcery.com>
Tue, 14 Aug 2012 02:31:00 +0000 (19:31 -0700)
ChangeLog
include/atomic.h

index 0377ac9b0397d2d78024b7a1fa4a85b93f1bfc7b..2adf44c736a52a03b267d2f4dc3864038377b09e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-08-13  Maxim Kuvyrkov  <maxim@codesourcery.com>
+
+        * include/atomic.h (atomic_exchange_and_add): Split into ...
+        (atomic_exchange_and_add_acq, atomic_exchange_and_add_rel): ... these.
+        New atomic macros.
+
 2012-08-13  Markus Trippelsdorf  <markus@trippelsdorf.de>
 
        * sysdeps/x86_64/fpu/libm-test-ulps: Update.
index 3ccb46d9ede8a569fa7ba6e56f0f9d3edf09f3bc..bc20772f2b721adf83ed7c8e79a2b5892ece12fc 100644 (file)
 
 
 /* Add VALUE to *MEM and return the old value of *MEM.  */
-#ifndef atomic_exchange_and_add
-# define atomic_exchange_and_add(mem, value) \
+#ifndef atomic_exchange_and_add_acq
+# ifdef atomic_exchange_and_add
+#  define atomic_exchange_and_add_acq(mem, value) \
+  atomic_exchange_and_add (mem, value)
+# else
+#  define atomic_exchange_and_add_acq(mem, value) \
   ({ __typeof (*(mem)) __atg6_oldval;                                        \
      __typeof (mem) __atg6_memp = (mem);                                     \
      __typeof (*(mem)) __atg6_value = (value);                               \
                                                   __atg6_oldval), 0));       \
                                                                              \
      __atg6_oldval; })
+# endif
 #endif
 
+#ifndef atomic_exchange_and_add_rel
+# define atomic_exchange_and_add_rel(mem, value) \
+  atomic_exchange_and_add_acq(mem, value)
+#endif
+
+#ifndef atomic_exchange_and_add
+# define atomic_exchange_and_add(mem, value) \
+  atomic_exchange_and_add_acq(mem, value)
+#endif
 
 #ifndef catomic_exchange_and_add
 # define catomic_exchange_and_add(mem, value) \