From: Carlos O'Donell Date: Tue, 18 Jul 2006 22:46:12 +0000 (+0000) Subject: 2006-07-18 Carlos O'Donell X-Git-Tag: glibc-2.16-ports-before-merge~843 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6dc958e5dd7a648516569725cdf845ff08c94e3e;p=thirdparty%2Fglibc.git 2006-07-18 Carlos O'Donell * 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. --- diff --git a/ChangeLog.hppa b/ChangeLog.hppa index d2c19a38f66..08da881bb77 100644 --- a/ChangeLog.hppa +++ b/ChangeLog.hppa @@ -1,3 +1,10 @@ +2006-07-18 Carlos O'Donell + + * 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 * sysdeps/hppa/tst-audit.h: New file. diff --git a/sysdeps/hppa/nptl/pthread_spin_lock.c b/sysdeps/hppa/nptl/pthread_spin_lock.c index 9a36967e6e6..966f5c91874 100644 --- a/sysdeps/hppa/nptl/pthread_spin_lock.c +++ b/sysdeps/hppa/nptl/pthread_spin_lock.c @@ -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; diff --git a/sysdeps/hppa/nptl/pthread_spin_trylock.c b/sysdeps/hppa/nptl/pthread_spin_trylock.c index 8d0ec1d9b87..609a62f6219 100644 --- a/sysdeps/hppa/nptl/pthread_spin_trylock.c +++ b/sysdeps/hppa/nptl/pthread_spin_trylock.c @@ -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; }