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.
This commit is contained in:
Ulrich Drepper 2004-03-07 10:40:53 +00:00
parent ead3275943
commit 4d1a02efc1
18 changed files with 381 additions and 38 deletions

View File

@ -1,3 +1,24 @@
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.

View File

@ -64,8 +64,21 @@ tf (void *arg)
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");
@ -80,12 +93,18 @@ do_test (void)
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)

View File

@ -1,4 +1,4 @@
/* 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.
@ -49,6 +49,20 @@ do_test (void)
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)
{
@ -64,7 +78,7 @@ do_test (void)
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);
@ -79,6 +93,12 @@ do_test (void)
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)
{

View File

@ -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,17 +71,37 @@ tf (void *arg)
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;

View File

@ -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.
@ -78,11 +78,25 @@ do_test (void)
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;
@ -106,6 +120,12 @@ do_test (void)
}
}
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)

View File

@ -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.
@ -87,6 +87,20 @@ do_test (void)
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)
{
@ -96,7 +110,7 @@ do_test (void)
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);
@ -145,6 +159,12 @@ do_test (void)
}
}
if (pthread_attr_destroy (&at) != 0)
{
puts ("attr_destroy failed");
return 1;
}
return 0;
}

View File

@ -1,4 +1,4 @@
/* 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.
@ -86,11 +86,25 @@ do_test (void)
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);
@ -106,6 +120,12 @@ do_test (void)
}
}
if (pthread_attr_destroy (&at) != 0)
{
puts ("attr_destroy failed");
return 1;
}
puts ("get lock outselves");
err = pthread_mutex_lock (&mut);

View File

@ -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)
{

View File

@ -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 Roland McGrath <roland@redhat.com>, 2002.
@ -71,6 +71,19 @@ main (void)
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,
@ -80,6 +93,12 @@ main (void)
exit (1);
}
if (pthread_attr_destroy (&at) != 0)
{
puts ("attr_destroy failed");
return 1;
}
for (i = 0; i < N; ++i)
{
void *v;

View File

@ -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.
@ -48,14 +48,6 @@ do_test (void)
exit (1);
}
pthread_t th[2];
if (pthread_create (&th[0], NULL, tf, NULL) != 0)
{
puts ("1st create failed");
exit (1);
}
pthread_attr_t a;
if (pthread_attr_init (&a) != 0)
@ -64,6 +56,20 @@ do_test (void)
exit (1);
}
if (pthread_attr_setstacksize (&a, 1 * 1024 * 1024) != 0)
{
puts ("attr_setstacksize failed");
return 1;
}
pthread_t th[2];
if (pthread_create (&th[0], &a, tf, NULL) != 0)
{
puts ("1st create failed");
exit (1);
}
if (pthread_attr_setdetachstate (&a, PTHREAD_CREATE_DETACHED) != 0)
{
puts ("attr_setdetachstate failed");

View File

@ -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.
@ -75,6 +75,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;
}
for (i = 0; i < 10; ++i)
{
int j;
@ -109,6 +123,12 @@ do_test (void)
}
}
if (pthread_attr_destroy (&a) != 0)
{
puts ("attr_destroy failed");
exit (1);
}
return 0;
}

View File

@ -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.
@ -88,15 +88,35 @@ 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;
}
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");

View File

@ -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 <drepper@redhat.com>, 2002.
@ -60,9 +60,22 @@ 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;
}
if (pthread_mutex_lock (&lock) != 0)
{
puts ("locking in parent failed");
@ -70,12 +83,18 @@ do_test (void)
}
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");

View File

@ -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 <drepper@redhat.com>, 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)
{

View File

@ -1,4 +1,4 @@
/* 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.
@ -132,6 +132,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;
}
for (i = 0; i < N; ++i)
{
if (pthread_mutex_init (&lock[i], NULL) != 0)
@ -144,13 +158,19 @@ do_test (void)
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 ();

View File

@ -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
}

View File

@ -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.
@ -140,14 +140,34 @@ 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;
}
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;

View File

@ -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.
@ -127,12 +127,26 @@ 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;
}
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);
@ -185,6 +199,12 @@ do_test (void)
}
}
if (pthread_attr_destroy (&a) != 0)
{
puts ("attr_destroy failed");
exit (1);
}
return 0;
#endif
}