remove some stray trailing space characters
[musl] / src / thread / pthread_rwlock_timedrdlock.c
1 #include "pthread_impl.h"
2
3 int pthread_rwlock_timedrdlock(pthread_rwlock_t *rw, const struct timespec *at)
4 {
5         int r, t;
6         while ((r=pthread_rwlock_tryrdlock(rw))==EBUSY) {
7                 if (!(r=rw->_rw_lock) || (r&0x7fffffff)!=0x7fffffff) continue;
8                 t = r | 0x80000000;
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;
14         }
15         return r;
16 }