From 48f006fc656c70757103dc9efa92d5775717576b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 8 Jul 2005 09:10:42 +0000 Subject: Updated to fedora-glibc-20050708T0811 --- linuxthreads/Examples/ex7.c | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 linuxthreads/Examples/ex7.c (limited to 'linuxthreads/Examples/ex7.c') diff --git a/linuxthreads/Examples/ex7.c b/linuxthreads/Examples/ex7.c deleted file mode 100644 index d9db33c5cd..0000000000 --- a/linuxthreads/Examples/ex7.c +++ /dev/null @@ -1,45 +0,0 @@ -/* This is a test of the special shutdown that occurs - when all threads, including the main one, call - pthread_exit(). It demonstrates that atexit - handlers are properly called, and that the - output is properly flushed even when stdout is - redirected to a file, and therefore fully buffered. */ - -#include -#include -#include - -#define NTHREADS 20 /* number of threads */ - -static void * -thread (void *arg) -{ - printf ("thread terminating\n"); - return 0; -} - -static void -cleanup (void) -{ - printf ("atexit handler called\n"); -} - -int -main (void) -{ - int i; - - atexit (cleanup); - - for (i = 0; i < NTHREADS; i++) - { - pthread_t id; - if (pthread_create (&id, 0, thread, 0) != 0) - { - fprintf (stderr, "pthread_create failed\n"); - abort (); - } - } - - pthread_exit (0); -} -- cgit v1.2.3-70-g09d2