1 #include "pthread_impl.h"
3 int pthread_rwlock_timedrdlock(pthread_rwlock_t *rw, const struct timespec *at)
6 while (pthread_rwlock_tryrdlock(rw)) {
7 if (!w) a_inc(&rw->__waiters), w++;
8 if (__timedwait(&rw->__wrlock, 1, CLOCK_REALTIME, at, 0)==ETIMEDOUT) {
9 if (w) a_dec(&rw->__waiters);
13 if (w) a_dec(&rw->__waiters);