Add 469782 to NEWS
[valgrind.git] / helgrind / tests / hg06_readshared.c
blob3904b44bb129fb5fb3b256489f81adc9eefe7500
1 /* All OK - test allowed read sharing */
3 #include <pthread.h>
4 #include <assert.h>
6 static int shared;
8 static void *t1(void *v)
10 return (void *)(long)(shared + 44);
13 static void *t2(void *v)
15 return (void *)(long)(shared + 55);
18 int main()
20 pthread_t a, b;
22 shared = 22;
24 pthread_create(&a, NULL, t1, NULL);
25 pthread_create(&b, NULL, t2, NULL);
27 pthread_join(a, NULL);
28 pthread_join(b, NULL);
30 assert(shared == 22);
32 return 0;