Add DRD suppression patterns for races triggered by std::ostream
[valgrind.git] / drd / tests / pth_uninitialized_cond.c
blob6acfbc7adbe2cd81ffd823b7ed5ff23be12a0e51
1 /* Test program to verify whether DRD only complains about uninitialized
2 * condition variables for dynamically allocated memory.
3 */
6 #include <pthread.h>
7 #include <stdio.h>
10 static pthread_cond_t s_cond1 = PTHREAD_COND_INITIALIZER;
11 static pthread_cond_t s_cond2 = PTHREAD_COND_INITIALIZER;
14 int main(int argc, char** argv)
16 fprintf(stderr, "Statically initialized condition variable.\n");
18 pthread_cond_signal(&s_cond1);
20 fprintf(stderr, "Uninitialized condition variable.\n");
22 *((char*)&s_cond2 + sizeof(s_cond2) - 1) ^= 1;
23 pthread_cond_signal(&s_cond2);
25 fprintf(stderr, "Done.\n");
27 return 0;