mirror of git://sourceware.org/git/glibc.git
Add explicit acquire/release semantics to atomic_exchange_and_add.
This commit is contained in:
parent
cc184e11fe
commit
51a9ba860a
|
@ -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>
|
2012-08-13 Markus Trippelsdorf <markus@trippelsdorf.de>
|
||||||
|
|
||||||
* sysdeps/x86_64/fpu/libm-test-ulps: Update.
|
* sysdeps/x86_64/fpu/libm-test-ulps: Update.
|
||||||
|
|
|
@ -198,8 +198,12 @@
|
||||||
|
|
||||||
|
|
||||||
/* Add VALUE to *MEM and return the old value of *MEM. */
|
/* Add VALUE to *MEM and return the old value of *MEM. */
|
||||||
#ifndef atomic_exchange_and_add
|
#ifndef atomic_exchange_and_add_acq
|
||||||
# define atomic_exchange_and_add(mem, value) \
|
# 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_oldval; \
|
||||||
__typeof (mem) __atg6_memp = (mem); \
|
__typeof (mem) __atg6_memp = (mem); \
|
||||||
__typeof (*(mem)) __atg6_value = (value); \
|
__typeof (*(mem)) __atg6_value = (value); \
|
||||||
|
@ -214,7 +218,17 @@
|
||||||
\
|
\
|
||||||
__atg6_oldval; })
|
__atg6_oldval; })
|
||||||
# endif
|
# 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
|
#ifndef catomic_exchange_and_add
|
||||||
# define catomic_exchange_and_add(mem, value) \
|
# define catomic_exchange_and_add(mem, value) \
|
||||||
|
|
Loading…
Reference in New Issue