summary refs log tree commit diff
path: root/nptl/sysdeps/ia64
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-18 00:31:30 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-18 00:31:30 +0000
commitbd0fa4cefd54effb6ff52c2a497517b95aa44c0a (patch)
tree173b9f1730edb8baa7a73c7b42206ab9d35bdc45 /nptl/sysdeps/ia64
parent0a8d800411363fd53a3992847dc29ee7ed109046 (diff)
downloadglibc-bd0fa4cefd54effb6ff52c2a497517b95aa44c0a.tar.gz
glibc-bd0fa4cefd54effb6ff52c2a497517b95aa44c0a.tar.xz
glibc-bd0fa4cefd54effb6ff52c2a497517b95aa44c0a.zip
Add __builtin_expect where appropriate.
Diffstat (limited to 'nptl/sysdeps/ia64')
-rw-r--r--nptl/sysdeps/ia64/bits/atomic.h26
-rw-r--r--nptl/sysdeps/ia64/pthread_spin_unlock.c6
2 files changed, 16 insertions, 16 deletions
diff --git a/nptl/sysdeps/ia64/bits/atomic.h b/nptl/sysdeps/ia64/bits/atomic.h
index cfccc6ad71..fab23076cd 100644
--- a/nptl/sysdeps/ia64/bits/atomic.h
+++ b/nptl/sysdeps/ia64/bits/atomic.h
@@ -76,20 +76,22 @@ typedef uintmax_t uatomic_max_t;
     __val = *__memp;							      \
     if (sizeof (*mem) == 4)						      \
       do								      \
-	__oldval = __val;						      \
-      while ((__val							      \
-	      = __arch_compare_and_exchange_32_val_acq (__memp,		      \
-							__oldval + __value,   \
-							__oldval))	      \
-	     != __oldval);						      \
+	{								      \
+	  __oldval = __val;						      \
+	  __val = __arch_compare_and_exchange_32_val_acq (__memp,	      \
+							  __oldval + __value, \
+							  __oldval);	      \
+	}								      \
+      while (__builtin_expect (__val != __oldval, 0));			      \
     else if (sizeof (*mem) == 8)					      \
       do								      \
-	__oldval = __val;						      \
-      while ((__val							      \
-	      = __arch_compare_and_exchange_64_val_acq (__memp,		      \
-							__oldval + __value,   \
-							__oldval))	      \
-	     != __oldval);						      \
+	{								      \
+	  __oldval = __val;						      \
+	  __val = __arch_compare_and_exchange_64_val_acq (__memp,	      \
+							  __oldval + __value, \
+							  __oldval);	      \
+	}								      \
+      while (__builtin_expect (__val != __oldval, 0));			      \
     else								      \
       abort ();								      \
     __oldval + __value; })
diff --git a/nptl/sysdeps/ia64/pthread_spin_unlock.c b/nptl/sysdeps/ia64/pthread_spin_unlock.c
index b3f1ff1628..90191880b7 100644
--- a/nptl/sysdeps/ia64/pthread_spin_unlock.c
+++ b/nptl/sysdeps/ia64/pthread_spin_unlock.c
@@ -17,15 +17,13 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-/* Ugly hack to avoid the declaration of pthread_spin_init.  */
-#define pthread_spin_init pthread_spin_init_XXX
 #include "pthreadP.h"
-#undef pthread_spin_init
+
 
 int
 pthread_spin_unlock (pthread_spinlock_t *lock)
 {
-  *lock = 0;
+  __sync_lock_release_si ((int *) lock);
   return 0;
 }
 strong_alias (pthread_spin_unlock, pthread_spin_init)