mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Clean up BUSY_WAIT_NOP and atomic_delay.
This patch combines BUSY_WAIT_NOP and atomic_delay into a new atomic_spin_nop function and adjusts all clients. The new function is put into atomic.h because what is best done in a spin loop is architecture-specific, and atomics must be used for spinning. The function name is meant to tell users that this has no effect on synchronization semantics but is a performance aid for spinning.
This commit is contained in:
@ -100,3 +100,6 @@ typedef uintmax_t uatomic_max_t;
|
||||
__asm __volatile ("membar #LoadLoad | #LoadStore" : : : "memory")
|
||||
#define atomic_write_barrier() \
|
||||
__asm __volatile ("membar #LoadStore | #StoreStore" : : : "memory")
|
||||
|
||||
extern void __cpu_relax (void);
|
||||
#define atomic_spin_nop () __cpu_relax ()
|
||||
|
@ -121,3 +121,6 @@ typedef uintmax_t uatomic_max_t;
|
||||
__asm __volatile ("membar #LoadLoad | #LoadStore" : : : "memory")
|
||||
#define atomic_write_barrier() \
|
||||
__asm __volatile ("membar #LoadStore | #StoreStore" : : : "memory")
|
||||
|
||||
extern void __cpu_relax (void);
|
||||
#define atomic_spin_nop () __cpu_relax ()
|
||||
|
Reference in New Issue
Block a user