mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-19 13:40:59 +08:00
Add atomic_exchange_relaxed.
* include/atomic.h (atomic_exchange_relaxed): New.
This commit is contained in:
parent
cb864fe0ec
commit
f0e3925bf3
@ -1,3 +1,7 @@
|
||||
2016-08-05 Torvald Riegel <triegel@redhat.com>
|
||||
|
||||
* include/atomic.h (atomic_exchange_relaxed): New.
|
||||
|
||||
2016-08-04 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* math/e_scalb.c: Do not include <fenv.h>.
|
||||
|
@ -588,6 +588,9 @@ void __atomic_link_error (void);
|
||||
__atomic_compare_exchange_n ((mem), (expected), (desired), 1, \
|
||||
__ATOMIC_RELEASE, __ATOMIC_RELAXED); })
|
||||
|
||||
# define atomic_exchange_relaxed(mem, desired) \
|
||||
({ __atomic_check_size((mem)); \
|
||||
__atomic_exchange_n ((mem), (desired), __ATOMIC_RELAXED); })
|
||||
# define atomic_exchange_acquire(mem, desired) \
|
||||
({ __atomic_check_size((mem)); \
|
||||
__atomic_exchange_n ((mem), (desired), __ATOMIC_ACQUIRE); })
|
||||
@ -684,6 +687,12 @@ void __atomic_link_error (void);
|
||||
*(expected) == __atg103_expected; })
|
||||
# endif
|
||||
|
||||
/* XXX Fall back to acquire MO because archs do not define a weaker
|
||||
atomic_exchange. */
|
||||
# ifndef atomic_exchange_relaxed
|
||||
# define atomic_exchange_relaxed(mem, val) \
|
||||
atomic_exchange_acq ((mem), (val))
|
||||
# endif
|
||||
# ifndef atomic_exchange_acquire
|
||||
# define atomic_exchange_acquire(mem, val) \
|
||||
atomic_exchange_acq ((mem), (val))
|
||||
|
Loading…
x
Reference in New Issue
Block a user