Add DRD suppression patterns for races triggered by std::ostream
[valgrind.git] / helgrind / tests / cond_timedwait_invalid.c
blob8c3bd8689473ca58bf501b1a07d58a41e2b68894
2 #include <time.h>
3 #include <pthread.h>
4 #include <assert.h>
5 #include <errno.h>
7 int main()
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;
17 abstime.tv_nsec = 0;
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);
25 return 0;