Add DRD suppression patterns for races triggered by std::ostream
[valgrind.git] / helgrind / tests / hg04_race.c
blob111195bf903f8d6ba91194bfc8be60d7b12215e7
1 /* A simple race */
3 #include <pthread.h>
4 #include <unistd.h>
6 static int shared;
8 static void *th(void *v)
10 shared++;
12 return 0;
15 int main()
17 pthread_t a, b;
19 pthread_create(&a, NULL, th, NULL);
20 sleep(1); /* force ordering */
21 pthread_create(&b, NULL, th, NULL);
23 pthread_join(a, NULL);
24 pthread_join(b, NULL);
26 return 0;