blob: 0541e7def64ec6fec4a4175bd448d3fee112e202 [file] [log] [blame]
jsgf12475f62003-10-16 06:09:41 +00001/* All OK - test allowed read sharing */
2
3#include <pthread.h>
4#include <assert.h>
5
6static int shared;
7
8static void *t1(void *v)
9{
10 return (void *)(shared + 44);
11}
12
13static void *t2(void *v)
14{
15 return (void *)(shared + 55);
16}
17
18int main()
19{
20 pthread_t a, b;
21
22 shared = 22;
23
24 pthread_create(&a, NULL, t1, NULL);
25 pthread_create(&b, NULL, t2, NULL);
26
27 pthread_join(a, NULL);
28 pthread_join(b, NULL);
29
30 assert(shared == 22);
31
32 return 0;
33}