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.
This commit is contained in:
Carlos O'Donell 2006-07-18 22:46:12 +00:00
parent f765aca3da
commit 6dc958e5dd
3 changed files with 9 additions and 2 deletions

View 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.

View 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;

View 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;
}