diff options
Diffstat (limited to 'nptl/tst-context1.c')
-rw-r--r-- | nptl/tst-context1.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/nptl/tst-context1.c b/nptl/tst-context1.c index 0edee00c7a..ff6e381636 100644 --- a/nptl/tst-context1.c +++ b/nptl/tst-context1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -111,13 +111,33 @@ do_test (void) } puts ("global OK"); + pthread_attr_t at; + + 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 (n = 0; n < N; ++n) - if (pthread_create (&th[n], NULL, tf, (void *) (long int) n) != 0) + if (pthread_create (&th[n], &at, tf, (void *) (long int) n) != 0) { puts ("create failed"); exit (1); } + if (pthread_attr_destroy (&at) != 0) + { + puts ("attr_destroy failed"); + return 1; + } + for (n = 0; n < N; ++n) if (pthread_join (th[n], NULL) != 0) { |