diff options
author | Andreas Jaeger <aj@suse.de> | 2000-12-27 17:14:56 +0000 |
---|---|---|
committer | Andreas Jaeger <aj@suse.de> | 2000-12-27 17:14:56 +0000 |
commit | a375a533a2445079390907b962464a379d25f5d5 (patch) | |
tree | d781d06615c1d76d029c48e1d7eb69dc21ecbf3d /linuxthreads/Examples/ex7.c | |
parent | 21112857299d8a7b9c04fcb2027ae5186acfcf4f (diff) | |
download | glibc-a375a533a2445079390907b962464a379d25f5d5.zip glibc-a375a533a2445079390907b962464a379d25f5d5.tar.gz glibc-a375a533a2445079390907b962464a379d25f5d5.tar.bz2 |
* 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 ----------------------------------------------------------------------
Diffstat (limited to 'linuxthreads/Examples/ex7.c')
-rw-r--r-- | linuxthreads/Examples/ex7.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/linuxthreads/Examples/ex7.c b/linuxthreads/Examples/ex7.c index 94b708b..d9db33c 100644 --- a/linuxthreads/Examples/ex7.c +++ b/linuxthreads/Examples/ex7.c @@ -9,32 +9,37 @@ #include <stdlib.h> #include <pthread.h> -#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); } |