17 gettimeofday(&tv,
NULL);
18 tp->tv_sec = tv.tv_sec;
19 tp->tv_nsec = tv.tv_usec*1000;
25 static bool times_up(
const struct timespec *timeout)
31 if(ts.tv_sec >= timeout->tv_sec &&
32 ts.tv_nsec >= timeout->tv_nsec)
48 result = pthread_mutex_trylock(mutex);
53 ts.tv_nsec = 10000000;
58 status = nanosleep(&ts, &ts);