diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-07-04 08:22:44 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-07-04 08:22:44 +0000 |
commit | 83b1b6d8faca6d279867c1c76f75e89786b76f4f (patch) | |
tree | d76728853dc9f8d2852e035c865e5e9732d65c81 /linuxthreads | |
parent | 0d6af3a86d34a5b32c46353fdc863216c1a44baf (diff) | |
download | glibc-83b1b6d8faca6d279867c1c76f75e89786b76f4f.zip glibc-83b1b6d8faca6d279867c1c76f75e89786b76f4f.tar.gz glibc-83b1b6d8faca6d279867c1c76f75e89786b76f4f.tar.bz2 |
Update.
2000-07-04 Ulrich Drepper <drepper@redhat.com>
* spinlock.c (__pthread_unlock): Properly place write barrier.
Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
Diffstat (limited to 'linuxthreads')
-rw-r--r-- | linuxthreads/ChangeLog | 5 | ||||
-rw-r--r-- | linuxthreads/spinlock.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 9928956..323de8e 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,8 @@ +2000-07-04 Ulrich Drepper <drepper@redhat.com> + + * spinlock.c (__pthread_unlock): Properly place write barrier. + Patch by Kaz Kylheku <kaz@ashi.footprints.net>. + 2000-07-03 Ulrich Drepper <drepper@redhat.com> * spinlock.c: Replace fast spinlocks by adaptive spinlocks which are diff --git a/linuxthreads/spinlock.c b/linuxthreads/spinlock.c index 02ab9a9..a63c653 100644 --- a/linuxthreads/spinlock.c +++ b/linuxthreads/spinlock.c @@ -34,7 +34,7 @@ (status & 1) == 1: spinlock is taken and (status & ~1L) is a pointer to the first waiting thread; other - waiting threads are linked via the p_nextlock + waiting threads are linked via the p_nextlock field. (status & 1) == 0: same as above, but spinlock is not taken. @@ -149,8 +149,8 @@ int __pthread_unlock(struct _pthread_fastlock * lock) #endif #if !defined HAS_COMPARE_AND_SWAP { - lock->__spinlock = 0; WRITE_MEMORY_BARRIER(); + lock->__spinlock = 0; return 0; } #endif @@ -160,7 +160,7 @@ again: oldstatus = lock->__status; while ((oldstatus = lock->__status) == 1) { - if (__compare_and_swap_with_release_semantics(&lock->__status, + if (__compare_and_swap_with_release_semantics(&lock->__status, oldstatus, 0)) return 0; } |