diff options
author | Carlos O'Donell <carlos@systemhalted.org> | 2006-07-18 22:46:12 +0000 |
---|---|---|
committer | Carlos O'Donell <carlos@systemhalted.org> | 2006-07-18 22:46:12 +0000 |
commit | 6dc958e5dd7a648516569725cdf845ff08c94e3e (patch) | |
tree | 204a92e328ab4aa36f1055e108124b25e810a008 /sysdeps/hppa | |
parent | f765aca3da66aa960ec8901613362c75ea755833 (diff) | |
download | glibc-6dc958e5dd7a648516569725cdf845ff08c94e3e.tar glibc-6dc958e5dd7a648516569725cdf845ff08c94e3e.tar.gz glibc-6dc958e5dd7a648516569725cdf845ff08c94e3e.tar.bz2 glibc-6dc958e5dd7a648516569725cdf845ff08c94e3e.zip |
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.
Diffstat (limited to 'sysdeps/hppa')
-rw-r--r-- | sysdeps/hppa/nptl/pthread_spin_lock.c | 2 | ||||
-rw-r--r-- | sysdeps/hppa/nptl/pthread_spin_trylock.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/hppa/nptl/pthread_spin_lock.c b/sysdeps/hppa/nptl/pthread_spin_lock.c index 9a36967e6e..966f5c9187 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 8d0ec1d9b8..609a62f621 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; } |