Add 469782 to NEWS
[valgrind.git] / helgrind / tests / cond_timedwait_test.c
blobe9b9be8a283e4049378dde3a6dc71421a82b8480
1 #include <pthread.h>
2 #include <string.h>
4 int main() {
5 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
6 pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
8 // This time has most definitely passed already. (Epoch)
9 struct timespec now;
10 memset(&now, 0, sizeof(now));
12 pthread_mutex_lock(&mutex);
13 pthread_cond_timedwait(&cond, &mutex, &now);
14 pthread_mutex_unlock(&mutex);
16 pthread_mutex_destroy(&mutex);
17 pthread_cond_destroy(&cond);
19 return 0;