about summary refs log tree commit diff
path: root/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
diff options
context:
space:
mode:
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)