NPTL/arc: notify kernel of the TP value
[uClibc.git] / test / pthread / ex6.c
blobffb6287711da77f3632a5d046f95854a6d9ff118
1 #include <errno.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include <pthread.h>
5 #include <time.h>
7 static void *
8 test_thread (void *v_param)
10 return NULL;
13 int
14 main (void)
16 unsigned long count;
17 struct timespec ts;
18 ts.tv_sec = 0;
19 ts.tv_nsec = 10 * 1000;
21 setvbuf (stdout, NULL, _IONBF, 0);
23 for (count = 0; count < 2000; ++count)
25 pthread_t thread;
26 int status;
28 status = pthread_create (&thread, NULL, test_thread, NULL);
29 if (status != 0)
31 printf ("status = %d, count = %lu: %s\n", status, count,
32 strerror (errno));
33 return 1;
35 else
37 printf ("count = %lu\n", count);
39 /* pthread_detach (thread); */
40 pthread_join (thread, NULL);
41 nanosleep (&ts, NULL);
43 return 0;