diff options
author | Torvald Riegel <triegel@redhat.com> | 2015-06-23 15:22:25 +0200 |
---|---|---|
committer | Torvald Riegel <triegel@redhat.com> | 2015-06-30 15:57:15 +0200 |
commit | 4eb984d3ab5641ce7992204756ac15a61f5f7181 (patch) | |
tree | 12603bae9d2582033a3186174d1379121e1ea642 /include/atomic.h | |
parent | e02920bc029019443326eecaa7b267b78ff2892e (diff) | |
download | glibc-4eb984d3ab5641ce7992204756ac15a61f5f7181.tar.gz glibc-4eb984d3ab5641ce7992204756ac15a61f5f7181.tar.xz glibc-4eb984d3ab5641ce7992204756ac15a61f5f7181.zip |
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.
Diffstat (limited to 'include/atomic.h')
-rw-r--r-- | include/atomic.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/atomic.h b/include/atomic.h index 7fd70c4c81..221bea0ad3 100644 --- a/include/atomic.h +++ b/include/atomic.h @@ -754,9 +754,10 @@ void __atomic_link_error (void); #endif /* !USE_ATOMIC_COMPILER_BUILTINS */ - -#ifndef atomic_delay -# define atomic_delay() do { /* nothing */ } while (0) +/* This operation does not affect synchronization semantics but can be used + in the body of a spin loop to potentially improve its efficiency. */ +#ifndef atomic_spin_nop +# define atomic_spin_nop() do { /* nothing */ } while (0) #endif #endif /* atomic.h */ |