diff options
Diffstat (limited to 'nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c')
-rw-r--r-- | nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c b/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c index 4f7b78dfd2..fb6382544e 100644 --- a/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c +++ b/nptl/sysdeps/pthread/pthread_rwlock_timedrdlock.c @@ -105,19 +105,18 @@ pthread_rwlock_timedrdlock (rwlock, abstime) break; } + int waitval = rwlock->__data.__readers_wakeup; + /* Free the lock. */ lll_mutex_unlock (rwlock->__data.__lock); /* Wait for the writer to finish. */ - result = lll_futex_timed_wait (&rwlock->__data.__readers_wakeup, 0, &rt); + result = lll_futex_timed_wait (&rwlock->__data.__readers_wakeup, + waitval, &rt); /* 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; - /* Did the futex call time out? */ if (result == -ETIMEDOUT) { |