Ignore machine-check MSRs
[freebsd-src/fkvm-freebsd.git] / tools / regression / tls / ttls2 / ttls2.c
blobf528e3dcc7398ae2489b049561bd60f8a5bcfd54
1 /* $FreeBSD$ */
3 #include <stdio.h>
4 #include <pthread.h>
6 int __thread i;
8 void *
9 foo1(void *arg)
11 printf("thread %p, &i = %p\n", pthread_self(), &i);
12 for (i = 0; i < 10; i++) {
13 printf("thread %p, i = %d\n", pthread_self(), i);
14 sleep(1);
18 void *
19 foo2(void *arg)
21 printf("thread %p, &i = %p\n", pthread_self(), &i);
22 for (i = 10; i > 0; i--) {
23 printf("thread %p, i = %d\n", pthread_self(), i);
24 sleep(1);
28 int main(int argc, char** argv)
30 pthread_t t1, t2;
32 pthread_create(&t1, 0, foo1, 0);
33 pthread_create(&t2, 0, foo2, 0);
34 pthread_join(t1, 0);
35 pthread_join(t2, 0);