From 4eb984d3ab5641ce7992204756ac15a61f5f7181 Mon Sep 17 00:00:00 2001 From: Torvald Riegel Date: Tue, 23 Jun 2015 15:22:25 +0200 Subject: 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. --- sysdeps/nacl/lowlevellock.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'sysdeps/nacl/lowlevellock.h') diff --git a/sysdeps/nacl/lowlevellock.h b/sysdeps/nacl/lowlevellock.h index 0b85d8d317..3634f1959a 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 -# 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); \ } \ -- cgit 1.4.1