diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-02-24 09:23:15 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-02-24 09:23:15 +0000 |
commit | 18a535792b7a63721a123e152266c4b8cf1fae8e (patch) | |
tree | b86a475d52a5cade9e9820808a7d8f165cf081aa /nptl/DESIGN-rwlock.txt | |
parent | 3724f268b15bdbd322cda97f88a965a68f2fd3ef (diff) | |
download | glibc-18a535792b7a63721a123e152266c4b8cf1fae8e.tar.gz |
Update.
* sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
Diffstat (limited to 'nptl/DESIGN-rwlock.txt')
-rw-r--r-- | nptl/DESIGN-rwlock.txt | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/nptl/DESIGN-rwlock.txt b/nptl/DESIGN-rwlock.txt index 6262a7a5b9..d97c084484 100644 --- a/nptl/DESIGN-rwlock.txt +++ b/nptl/DESIGN-rwlock.txt @@ -42,13 +42,12 @@ pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) break; rwlock->nr_readers_queued++; + val = rwlock->readers_wakeup; lll_unlock(rwlock->lock); - futex_wait(&rwlock->readers_wakeup, 0) + futex_wait(&rwlock->readers_wakeup, val) lll_lock(rwlock->lock); - if (!--rwlock->nr_readers_queued) - rwlock->readers_wakeup = 0; } rwlock->readers++; lll_unlock(rwlock->lock); @@ -73,13 +72,13 @@ pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) break; rwlock->nr_writers_queued++; + val = rwlock->writer_wakeup; lll_unlock(rwlock->lock); - futex_wait(&rwlock->writer_wakeup, 0); + futex_wait(&rwlock->writer_wakeup, val); lll_lock(rwlock->lock); rwlock->nr_writers_queued--; - rwlock->writer_wakeup = 0; } rwlock->writer = pthread_self(); lll_unlock(rwlock->lock); @@ -96,11 +95,11 @@ pthread_rwlock_unlock(pthread_rwlock_t *rwlock) if (!rwlock->readers) { if (rwlock->nr_writers_queued) { - rwlock->writer_wakeup = 1; + ++rwlock->writer_wakeup; futex_wake(&rwlock->writer_wakeup, 1); } else if (rwlock->nr_readers_queued) { - rwlock->readers_wakeup = 1; + ++rwlock->readers_wakeup; futex_wake(&rwlock->readers_wakeup, MAX_INT); } } |