+2004-03-07 Ulrich Drepper <drepper@redhat.com>
+
+ * 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.
+
2004-03-05 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
static int
do_test (void)
{
+ pthread_attr_t at;
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;
+ }
+
if (pthread_barrier_init (&b1, NULL, N) != 0)
{
puts ("1st barrier_init failed");
pthread_t th[N - 1];
for (cnt = 0; cnt < N - 1; ++cnt)
- if (pthread_create (&th[cnt], NULL, tf, NULL) != 0)
+ if (pthread_create (&th[cnt], &at, tf, NULL) != 0)
{
puts ("pthread_create failed");
return 1;
}
+ if (pthread_attr_destroy (&at) != 0)
+ {
+ puts ("attr_destroy failed");
+ return 1;
+ }
+
tf (NULL);
for (cnt = 0; cnt < N - 1; ++cnt)
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
exit (1);
}
+ 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;
+ }
+
int i;
for (i = 0; i < N; ++i)
{
exit (1);
}
- if (pthread_create (&th[i], NULL, tf, (void *) (long int) i) != 0)
+ if (pthread_create (&th[i], &at, tf, (void *) (long int) i) != 0)
{
puts ("create failed");
exit (1);
printf ("created thread %d\n", i);
}
+ if (pthread_attr_destroy (&at) != 0)
+ {
+ puts ("attr_destroy failed");
+ return 1;
+ }
+
int result = 0;
for (i = 0; i < N; ++i)
{
-/* 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.
static int
do_test (void)
{
+ 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;
+ }
+
#define N 20
int i;
pthread_t th[N];
for (i = 0; i < N; ++i)
- if (pthread_create (&th[i], NULL, tf, (void *) (long int) i) != 0)
+ if (pthread_create (&th[i], &at, tf, (void *) (long int) i) != 0)
{
puts ("create failed");
exit (1);
}
+ if (pthread_attr_destroy (&at) != 0)
+ {
+ puts ("attr_destroy failed");
+ return 1;
+ }
+
for (i = 0; i < N; ++i)
{
void *r;
-/* 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.
cl[0] = CLOCK_THREAD_CPUTIME_ID;
#endif
+ 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;
+ }
+
int i;
int e;
for (i = 0; i < N; ++i)
{
- if (pthread_create (&th[i], NULL, tf, NULL) != 0)
+ if (pthread_create (&th[i], &at, tf, NULL) != 0)
{
puts ("create failed");
return 1;
}
}
+ if (pthread_attr_destroy (&at) != 0)
+ {
+ puts ("attr_destroy failed");
+ return 1;
+ }
+
struct timespec t[N + 1];
for (i = 0; i < N + 1; ++i)
if (clock_gettime (cl[i], &t[i]) != 0)
-/* 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.
exit (1);
}
+ 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;
+ }
+
int r;
for (r = 0; r < ROUNDS; ++r)
{
pthread_t th[N];
for (i = 0; i < N; ++i)
{
- if (pthread_create (&th[i], NULL, tf, NULL) != 0)
+ if (pthread_create (&th[i], &at, tf, NULL) != 0)
{
puts ("create failed");
exit (1);
}
}
+ if (pthread_attr_destroy (&at) != 0)
+ {
+ puts ("attr_destroy failed");
+ return 1;
+ }
+
return 0;
}
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
exit (1);
}
+ 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 (i = 0; i < N; ++i)
{
printf ("create thread %d\n", i);
- err = pthread_create (&th[i], NULL, tf, (void *) (long int) i);
+ err = pthread_create (&th[i], &at, tf, (void *) (long int) i);
if (err != 0)
error (EXIT_FAILURE, err, "cannot create thread %d", i);
}
}
+ if (pthread_attr_destroy (&at) != 0)
+ {
+ puts ("attr_destroy failed");
+ return 1;
+ }
+
puts ("get lock outselves");
err = pthread_mutex_lock (&mut);
-/* 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.
}
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)
{
-/* 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 Roland McGrath <roland@redhat.com>, 2002.
pthread_t th[N];
int i;
int result = 0;
+ 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 (i = 0; i < N; ++i)
if (pthread_create (&th[i], NULL, thread_function,
exit (1);
}
+ if (pthread_attr_destroy (&at) != 0)
+ {
+ puts ("attr_destroy failed");
+ return 1;
+ }
+
for (i = 0; i < N; ++i)
{
void *v;
-/* 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.
exit (1);
}
- pthread_t th[2];
+ pthread_attr_t a;
- if (pthread_create (&th[0], NULL, tf, NULL) != 0)
+ if (pthread_attr_init (&a) != 0)
{
- puts ("1st create failed");
+ puts ("attr_init failed");
exit (1);
}
- pthread_attr_t a;
+ if (pthread_attr_setstacksize (&a, 1 * 1024 * 1024) != 0)
+ {
+ puts ("attr_setstacksize failed");
+ return 1;
+ }
- if (pthread_attr_init (&a) != 0)
+ pthread_t th[2];
+
+ if (pthread_create (&th[0], &a, tf, NULL) != 0)
{
- puts ("attr_init failed");
+ puts ("1st create failed");
exit (1);
}
-/* 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.
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;
+ }
+
for (i = 0; i < 10; ++i)
{
int j;
}
}
+ if (pthread_attr_destroy (&a) != 0)
+ {
+ puts ("attr_destroy failed");
+ exit (1);
+ }
+
return 0;
}
-/* 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.
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;
+ }
+
pthread_t th[N];
int i;
for (i = 0; i < N; ++i)
- if (pthread_create (&th[i], NULL, tf, NULL) != 0)
+ if (pthread_create (&th[i], &a, tf, NULL) != 0)
{
puts ("create failed");
exit (1);
}
+ if (pthread_attr_destroy (&a) != 0)
+ {
+ puts ("attr_destroy failed");
+ exit (1);
+ }
+
if (sem_init (&sem, 0, 0) != 0)
{
puts ("sem_init failed");
-/* 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 <drepper@redhat.com>, 2002.
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;
+ }
+
if (pthread_mutex_lock (&lock) != 0)
{
puts ("locking in parent failed");
}
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 ("creating thread %d failed\n", cnt);
return 1;
}
+ if (pthread_attr_destroy (&at) != 0)
+ {
+ puts ("attr_destroy failed");
+ return 1;
+ }
+
if (pthread_mutex_unlock (&lock) != 0)
{
puts ("unlocking in parent failed");
-/* 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 <drepper@redhat.com>, 2002.
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)
{
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
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;
+ }
+
for (i = 0; i < N; ++i)
{
if (pthread_mutex_init (&lock[i], NULL) != 0)
printf ("mutex_lock[%d] failed\n", i);
}
- if (pthread_create (&th[i], NULL, tf, (void *) (long int) i) != 0)
+ if (pthread_create (&th[i], &a, tf, (void *) (long int) i) != 0)
{
printf ("create of thread %d failed\n", i);
exit (1);
}
}
+ if (pthread_attr_destroy (&a) != 0)
+ {
+ puts ("attr_destroy failed");
+ exit (1);
+ }
+
int result = 0;
unsigned int r = 42;
pid_t pid = getpid ();
-/* 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.
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)
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);
}
}
+ if (pthread_attr_destroy (&a) != 0)
+ {
+ puts ("attr_destroy failed");
+ exit (1);
+ }
+
return 0;
#endif
}
-/* 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.
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;
+ }
+
int i;
for (i = 0; i < N; ++i)
- if (pthread_create (&th[i], NULL, tf, cbs[i]) != 0)
+ if (pthread_create (&th[i], &a, tf, cbs[i]) != 0)
{
puts ("pthread_create failed");
exit (1);
}
+ if (pthread_attr_destroy (&a) != 0)
+ {
+ puts ("attr_destroy failed");
+ exit (1);
+ }
+
pthread_barrier_wait (&b);
sigset_t ss;
-/* 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.
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;
+ }
+
int r;
for (r = 0; r < 10; ++r)
{
int i;
for (i = 0; i < N; ++i)
- if (pthread_create (&th[i], NULL, tf, cbs[i]) != 0)
+ if (pthread_create (&th[i], &a, tf, cbs[i]) != 0)
{
puts ("pthread_create failed");
exit (1);
}
}
+ if (pthread_attr_destroy (&a) != 0)
+ {
+ puts ("attr_destroy failed");
+ exit (1);
+ }
+
return 0;
#endif
}