summaryrefslogtreecommitdiff
path: root/nptl/tst-kill4.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-09-19 18:46:51 +0000
committerJakub Jelinek <jakub@redhat.com>2006-09-19 18:46:51 +0000
commit61d906ea3820eefbe91548b295a95f3bc26c45a2 (patch)
tree79398a8e14fbe36db2c44baf134c8edddcd2083d /nptl/tst-kill4.c
parent3d6b6fbc1f374f55fdb9e277d7e851fe112d68ff (diff)
Updated to fedora-glibc-20060919T1816
Diffstat (limited to 'nptl/tst-kill4.c')
-rw-r--r--nptl/tst-kill4.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/nptl/tst-kill4.c b/nptl/tst-kill4.c
index 4e7ff5eaf4..a1b97e7b26 100644
--- a/nptl/tst-kill4.c
+++ b/nptl/tst-kill4.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -35,13 +35,30 @@ tf (void *a)
int
do_test (void)
{
+ pthread_attr_t at;
+ if (pthread_attr_init (&at) != 0)
+ {
+ puts ("attr_create failed");
+ exit (1);
+ }
+
+ /* Limit thread stack size, because if it is too large, pthread_join
+ will free it immediately rather than put it into stack cache. */
+ if (pthread_attr_setstacksize (&at, 2 * 1024 * 1024) != 0)
+ {
+ puts ("setstacksize failed");
+ exit (1);
+ }
+
pthread_t th;
- if (pthread_create (&th, NULL, tf, NULL) != 0)
+ if (pthread_create (&th, &at, tf, NULL) != 0)
{
puts ("create failed");
exit (1);
}
+ pthread_attr_destroy (&at);
+
if (pthread_join (th, NULL) != 0)
{
puts ("join failed");