aboutsummaryrefslogtreecommitdiff
path: root/nptl/tst-tls1.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/tst-tls1.c')
-rw-r--r--nptl/tst-tls1.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/nptl/tst-tls1.c b/nptl/tst-tls1.c
index 3668162..4e19122 100644
--- a/nptl/tst-tls1.c
+++ b/nptl/tst-tls1.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.
@@ -71,6 +71,20 @@ do_test (void)
exit (1);
}
+ pthread_attr_t a;
+
+ if (pthread_attr_init (&a) != 0)
+ {
+ puts ("attr_init failed");
+ exit (1);
+ }
+
+ if (pthread_attr_setstacksize (&a, 1 * 1024 * 1024) != 0)
+ {
+ puts ("attr_setstacksize failed");
+ return 1;
+ }
+
#define N 10
int i;
for (i = 0; i < N; ++i)
@@ -79,7 +93,7 @@ do_test (void)
pthread_t th[M];
int j;
for (j = 0; j < M; ++j, ++s.a)
- if (pthread_create (&th[j], NULL, tf, NULL) != 0)
+ if (pthread_create (&th[j], &a, tf, NULL) != 0)
{
puts ("pthread_create failed");
exit (1);
@@ -93,6 +107,12 @@ do_test (void)
}
}
+ if (pthread_attr_destroy (&a) != 0)
+ {
+ puts ("attr_destroy failed");
+ exit (1);
+ }
+
return 0;
#endif
}