1 #include "pthread_impl.h"
3 int pthread_mutex_timedlock(pthread_mutex_t *m, const struct timespec *at)
6 while ((r=pthread_mutex_trylock(m)) == EBUSY) {
7 if (!w) a_inc(&m->__waiters), w++;
8 if (__timedwait(&m->__lock, 1, CLOCK_REALTIME, at, 0) == ETIMEDOUT) {
9 if (w) a_dec(&m->__waiters);
13 if (w) a_dec(&m->__waiters);