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/sysdeps/pthread/pthread_rwlock_rdlock.c | |
parent | 3724f268b15bdbd322cda97f88a965a68f2fd3ef (diff) | |
download | glibc-18a535792b7a63721a123e152266c4b8cf1fae8e.tar glibc-18a535792b7a63721a123e152266c4b8cf1fae8e.tar.gz glibc-18a535792b7a63721a123e152266c4b8cf1fae8e.tar.bz2 glibc-18a535792b7a63721a123e152266c4b8cf1fae8e.zip |
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/sysdeps/pthread/pthread_rwlock_rdlock.c')
-rw-r--r-- | nptl/sysdeps/pthread/pthread_rwlock_rdlock.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c b/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c index b556ccfd1c..197af9c970 100644 --- a/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c +++ b/nptl/sysdeps/pthread/pthread_rwlock_rdlock.c @@ -72,18 +72,16 @@ __pthread_rwlock_rdlock (rwlock) break; } + int waitval = rwlock->__data.__readers_wakeup; + /* Free the lock. */ lll_mutex_unlock (rwlock->__data.__lock); /* Wait for the writer to finish. */ - lll_futex_wait (&rwlock->__data.__readers_wakeup, 0); + lll_futex_wait (&rwlock->__data.__readers_wakeup, waitval); /* Get the lock. */ lll_mutex_lock (rwlock->__data.__lock); - - /* To start over again, remove the thread from the reader list. */ - if (--rwlock->__data.__nr_readers_queued == 0) - rwlock->__data.__readers_wakeup = 0; } /* We are done, free the lock. */ |