FreeBSD regtest: add missing helgrind expecteds
[valgrind.git] / helgrind / tests / pth_mempcpy_false_races.c
blob90716435d611e9d94c40c74519d9d984eaac3ef4
1 /* Related bugs:
2 * https://bugs.kde.org/show_bug.cgi?id=352130
3 * https://bugs.kde.org/show_bug.cgi?id=450962
4 * This reproducer has no real race conditions but since helgrind doesn't see
5 * or know about the glibc internal locking done for FILE *state, it will report
6 * a race when several threads run printf due to this fact.
7 */
9 #include <stdio.h>
10 #include <pthread.h>
12 pthread_t thread;
14 void* thread3 (void* d)
16 int count3 = 0;
18 while(count3 < 100){
19 printf("Thread 3: %d\n", count3++);
21 return NULL;
24 void* thread2 (void* d)
26 int count2 = 0;
28 while(count2 < 1000){
30 printf("Thread 2: %d\n", count2++);
32 return NULL;
35 int main (){
37 pthread_create (&thread, NULL, thread2, NULL);
38 pthread_create (&thread, NULL, thread3, NULL);
40 //Thread 1
41 int count1 = 0;
43 while(count1 < 10){
44 printf("Thread 1: %d\n", count1++);
47 pthread_join(thread,NULL);
48 return 0;