Ignore machine-check MSRs
[freebsd-src/fkvm-freebsd.git] / tools / regression / tls / ttls4 / ttls4.c
blobd55e51bfcd8b977f639fd0e74f21e05457b719b1
1 /*
2 * This program tests if a new thread's initial tls data
3 * is clean.
5 * David Xu <davidxu@freebsd.org>
7 * $FreeBSD$
8 */
10 #include <stdio.h>
11 #include <pthread.h>
12 #include <unistd.h>
14 int __thread n;
16 void *f1(void *arg)
18 if (n != 0) {
19 printf("bug, n == %d \n", n);
20 exit(1);
22 n = 1;
23 return (0);
26 int main()
28 pthread_t td;
29 int i;
31 for (i = 0; i < 1000; ++i) {
32 pthread_create(&td, NULL, f1, NULL);
33 pthread_join(td, NULL);
35 sleep(2);
36 for (i = 0; i < 1000; ++i) {
37 pthread_create(&td, NULL, f1, NULL);
38 pthread_join(td, NULL);
40 return (0);