From a375a533a2445079390907b962464a379d25f5d5 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 27 Dec 2000 17:14:56 +0000 Subject: * Examples/ex13.c: Make local functions static. * ecmutex.c: Likewise. * Examples/ex14.c: Likewise. * Examples/ex2.c: Make local functions static; reformat. * Examples/ex1.c: Likewise. * Examples/ex4.c: Likewise. * Examples/ex5.c: Likewise. * Examples/ex7.c: Likewise. CVS ---------------------------------------------------------------------- --- linuxthreads/Examples/ex7.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'linuxthreads/Examples/ex7.c') diff --git a/linuxthreads/Examples/ex7.c b/linuxthreads/Examples/ex7.c index 94b708b56b..d9db33c5cd 100644 --- a/linuxthreads/Examples/ex7.c +++ b/linuxthreads/Examples/ex7.c @@ -9,32 +9,37 @@ #include #include -#define NTHREADS 20 /* number of threads */ +#define NTHREADS 20 /* number of threads */ -static void *thread(void *arg) +static void * +thread (void *arg) { - printf("thread terminating\n"); + printf ("thread terminating\n"); return 0; } -void cleanup(void) +static void +cleanup (void) { - printf("atexit handler called\n"); + printf ("atexit handler called\n"); } -int main(void) +int +main (void) { int i; - atexit(cleanup); + 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(); + 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); + pthread_exit (0); } -- cgit v1.2.3