aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/nacl
diff options
context:
space:
mode:
authorTorvald Riegel <triegel@redhat.com>2015-06-23 15:22:25 +0200
committerTorvald Riegel <triegel@redhat.com>2015-06-30 15:57:15 +0200
commit4eb984d3ab5641ce7992204756ac15a61f5f7181 (patch)
tree12603bae9d2582033a3186174d1379121e1ea642 /sysdeps/nacl
parente02920bc029019443326eecaa7b267b78ff2892e (diff)
downloadglibc-4eb984d3ab5641ce7992204756ac15a61f5f7181.zip
glibc-4eb984d3ab5641ce7992204756ac15a61f5f7181.tar.gz
glibc-4eb984d3ab5641ce7992204756ac15a61f5f7181.tar.bz2
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 'sysdeps/nacl')
-rw-r--r--sysdeps/nacl/lll_timedwait_tid.c2
-rw-r--r--sysdeps/nacl/lowlevellock.h6
2 files changed, 2 insertions, 6 deletions
diff --git a/sysdeps/nacl/lll_timedwait_tid.c b/sysdeps/nacl/lll_timedwait_tid.c
index ecaf0b1..ef544cf 100644
--- a/sysdeps/nacl/lll_timedwait_tid.c
+++ b/sysdeps/nacl/lll_timedwait_tid.c
@@ -40,7 +40,7 @@ __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
finish quick enough that the timeout doesn't matter. If any
thread ever stays in this state for long, there is something
catastrophically wrong. */
- BUSY_WAIT_NOP;
+ atomic_spin_nop ();
else
{
assert (tid > 0);
diff --git a/sysdeps/nacl/lowlevellock.h b/sysdeps/nacl/lowlevellock.h
index 0b85d8d..3634f19 100644
--- a/sysdeps/nacl/lowlevellock.h
+++ b/sysdeps/nacl/lowlevellock.h
@@ -21,10 +21,6 @@
/* Everything except the exit handling is the same as the generic code. */
# include <sysdeps/nptl/lowlevellock.h>
-# ifndef BUSY_WAIT_NOP
-# define BUSY_WAIT_NOP __sync_synchronize ()
-# endif
-
/* See exit-thread.h for details. */
# define NACL_EXITING_TID 1
@@ -36,7 +32,7 @@
while ((__tid = atomic_load_relaxed (__tidp)) != 0) \
{ \
if (__tid == NACL_EXITING_TID) \
- BUSY_WAIT_NOP; \
+ atomic_spin_nop (); \
else \
lll_futex_wait (__tidp, __tid, LLL_PRIVATE); \
} \