2006-07-18 Carlos O'Donell <carlos@systemhalted.org>
authorCarlos O'Donell <carlos@systemhalted.org>
Tue, 18 Jul 2006 22:46:12 +0000 (22:46 +0000)
committerCarlos O'Donell <carlos@systemhalted.org>
Tue, 18 Jul 2006 22:46:12 +0000 (22:46 +0000)
* sysdeps/hppa/nptl/pthread_spin_lock.c (pthread_spin_lock): Swap
newval and oldval.
* sysdeps/hppa/nptl/pthread_spin_trylock.c (pthread_spin_trylock):
Likewise.

ChangeLog.hppa
sysdeps/hppa/nptl/pthread_spin_lock.c
sysdeps/hppa/nptl/pthread_spin_trylock.c

index d2c19a3..08da881 100644 (file)
@@ -1,3 +1,10 @@
+2006-07-18  Carlos O'Donell  <carlos@systemhalted.org>
+
+       * sysdeps/hppa/nptl/pthread_spin_lock.c (pthread_spin_lock): Swap
+       newval and oldval.
+       * sysdeps/hppa/nptl/pthread_spin_trylock.c (pthread_spin_trylock):
+       Likewise.
+
 2006-07-16  Jeff Bailey  <jbailey@ubuntu.com>
 
        * sysdeps/hppa/tst-audit.h: New file.
index 9a36967..966f5c9 100644 (file)
@@ -31,7 +31,7 @@ pthread_spin_lock (pthread_spinlock_t *lock)
   return 0;
 #endif
 
-  while (atomic_compare_and_exchange_val_acq(lock, 0, 1) == 1)
+  while (atomic_compare_and_exchange_val_acq(lock, 1, 0) == 1)
     while (*lock == 1);
   
   return 0;
index 8d0ec1d..609a62f 100644 (file)
@@ -29,6 +29,6 @@ pthread_spin_trylock (pthread_spinlock_t *lock)
   return __ldcw (a) ? 0 : EBUSY;
 #endif
 
-  return atomic_compare_and_exchange_val_acq(lock, 0, 1) ? EBUSY : 0;
+  return atomic_compare_and_exchange_val_acq(lock, 1, 0) ? EBUSY : 0;
 
 }