1 #include "pthread_impl.h"
3 int pthread_rwlock_timedrdlock(pthread_rwlock_t *rw, const struct timespec *at)
6 while ((r=pthread_rwlock_tryrdlock(rw))==EBUSY) {
7 if (!(r=rw->_rw_lock) || (r&0x7fffffff)!=0x7fffffff) continue;
9 a_inc(&rw->_rw_waiters);
10 a_cas(&rw->_rw_lock, r, t);
11 r = __timedwait(&rw->_rw_lock, t, CLOCK_REALTIME, at, 0, 0, 0);
12 a_dec(&rw->_rw_waiters);
13 if (r && r != EINTR) return r;