1 /* Variant of ex6, but this time we use pthread_exit (). */
9 __attribute__ ((noreturn))
10 test_thread (void *v_param)
20 setvbuf (stdout, NULL, _IONBF, 0);
22 for (count = 0; count < 2000; ++count)
27 status = pthread_create (&thread, NULL, test_thread, NULL);
30 printf ("status = %d, count = %lu: %s\n", status, count,
36 printf ("count = %lu\n", count);
38 /* pthread_detach (thread); */
39 if (pthread_join (thread, NULL) != 0)
41 printf ("join failed, count %lu\n", count);