aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/Examples/ex7.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2000-12-27 17:14:56 +0000
committerAndreas Jaeger <aj@suse.de>2000-12-27 17:14:56 +0000
commita375a533a2445079390907b962464a379d25f5d5 (patch)
treed781d06615c1d76d029c48e1d7eb69dc21ecbf3d /linuxthreads/Examples/ex7.c
parent21112857299d8a7b9c04fcb2027ae5186acfcf4f (diff)
downloadglibc-a375a533a2445079390907b962464a379d25f5d5.tar
glibc-a375a533a2445079390907b962464a379d25f5d5.tar.gz
glibc-a375a533a2445079390907b962464a379d25f5d5.tar.bz2
glibc-a375a533a2445079390907b962464a379d25f5d5.zip
* 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.c33
1 files changed, 19 insertions, 14 deletions
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 <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);
}