9 struct timespec abstime
;
10 pthread_mutex_t mutex
= PTHREAD_MUTEX_INITIALIZER
;
11 pthread_cond_t cond
= PTHREAD_COND_INITIALIZER
;
16 abstime
.tv_sec
= time(NULL
) + 2;
19 abstime
.tv_nsec
+= 1000000000;
21 assert(pthread_mutex_lock(&mutex
)==0);
22 assert(pthread_cond_timedwait(&cond
, &mutex
, &abstime
)==EINVAL
);
23 assert(pthread_mutex_unlock(&mutex
)==0);