about summary refs log tree commit diff
path: root/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-24 09:23:15 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-24 09:23:15 +0000
commit18a535792b7a63721a123e152266c4b8cf1fae8e (patch)
treeb86a475d52a5cade9e9820808a7d8f165cf081aa /nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
parent3724f268b15bdbd322cda97f88a965a68f2fd3ef (diff)
downloadglibc-18a535792b7a63721a123e152266c4b8cf1fae8e.tar.gz
glibc-18a535792b7a63721a123e152266c4b8cf1fae8e.tar.xz
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_timedwrlock.c')
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
index 4c0dc38348..0715f835af 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
@@ -95,18 +95,20 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
 	  break;
 	}
 
+      int waitval = rwlock->__data.__writer_wakeup;
+
       /* Free the lock.  */
       lll_mutex_unlock (rwlock->__data.__lock);
 
       /* Wait for the writer or reader(s) to finish.  */
-      result = lll_futex_timed_wait (&rwlock->__data.__writer_wakeup, 0, &rt);
+      result = lll_futex_timed_wait (&rwlock->__data.__writer_wakeup,
+				     waitval, &rt);
 
       /* Get the lock.  */
       lll_mutex_lock (rwlock->__data.__lock);
 
       /* To start over again, remove the thread from the writer list.  */
       --rwlock->__data.__nr_writers_queued;
-      rwlock->__data.__writer_wakeup = 0;
 
       /* Did the futex call time out?  */
       if (result == -ETIMEDOUT)