about summary refs log tree commit diff
path: root/sysdeps/hppa/nptl/pthread_spin_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/hppa/nptl/pthread_spin_init.c')
-rw-r--r--sysdeps/hppa/nptl/pthread_spin_init.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/hppa/nptl/pthread_spin_init.c b/sysdeps/hppa/nptl/pthread_spin_init.c
index c83669eb91..b0ff78917b 100644
--- a/sysdeps/hppa/nptl/pthread_spin_init.c
+++ b/sysdeps/hppa/nptl/pthread_spin_init.c
@@ -20,9 +20,9 @@
 int
 pthread_spin_init (pthread_spinlock_t *lock, int pshared)
 {
-  int tmp = 0;
-  /* This should be a memory barrier to newer compilers */
-  __asm__ __volatile__ ("stw,ma %1,0(%0)"
-                        : : "r" (lock), "r" (tmp) : "memory");
+  /* The LWS-CAS operation on hppa is a synthetic atomic operation
+     that doesn't provide the type of coherency that we need. Therefore
+     we force that coherency by using LWS-CAS again.  */
+  atomic_exchange_rel (lock, 0);
   return 0;
 }