From 4d1a02efc1117763c67fe012642381e3106500cf Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 7 Mar 2004 10:40:53 +0000 Subject: Update. 2004-03-07 Ulrich Drepper * tst-once4.c: Remove unnecessary macro definition. * tst-mutex7.c (do_test): Limit thread stack size. * tst-once2.c (do_test): Likewise. * tst-tls3.c (do_test): Likewise. * tst-tls1.c (do_test): Likewise. * tst-signal3.c (do_test): Likewise. * tst-kill6.c (do_test): Likewise. * tst-key4.c (do_test): Likewise. * tst-join4.c (do_test): Likewise. * tst-fork1.c (do_test): Likewise. * tst-context1.c (do_test): Likewise. * tst-cond2.c (do_test): Likewise. * tst-cond10.c (do_test): Likewise. * tst-clock2.c (do_test): Likewise. * tst-cancel10.c (do_test): Likewise. * tst-basic2.c (do_test): Likewise. * tst-barrier4.c (do_test): Likewise. --- nptl/tst-once2.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'nptl/tst-once2.c') diff --git a/nptl/tst-once2.c b/nptl/tst-once2.c index 3fbc4a975d..c606345384 100644 --- a/nptl/tst-once2.c +++ b/nptl/tst-once2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -60,16 +60,35 @@ tf (void *arg) static int do_test (void) { + pthread_attr_t at; pthread_t th[N]; int cnt; + if (pthread_attr_init (&at) != 0) + { + puts ("attr_init failed"); + return 1; + } + + if (pthread_attr_setstacksize (&at, 1 * 1024 * 1024) != 0) + { + puts ("attr_setstacksize failed"); + return 1; + } + for (cnt = 0; cnt < N; ++cnt) - if (pthread_create (&th[cnt], NULL, tf, (void *) (long int) cnt) != 0) + if (pthread_create (&th[cnt], &at, tf, (void *) (long int) cnt) != 0) { printf ("creation of thread %d failed\n", cnt); return 1; } + if (pthread_attr_destroy (&at) != 0) + { + puts ("attr_destroy failed"); + return 1; + } + for (cnt = 0; cnt < N; ++cnt) if (pthread_join (th[cnt], NULL) != 0) { -- cgit v1.2.3