summaryrefslogtreecommitdiff
path: root/nptl/tst-basic2.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-08 19:44:33 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-08 19:44:33 +0000
commit696e556ea9b85beb8e6bad132d3d4dbdb5ab36a6 (patch)
tree4db6b271413792b54210ce0a214668cdde164d41 /nptl/tst-basic2.c
parent34c86f425441d13e9e6cebd2ce1ebd99fc373ce2 (diff)
Update.
2003-02-08 Ulrich Drepper <drepper@redhat.com> * tst-cond2.c: Rearrange code to not rely on behavior undefined according to POSIX. * tst-basic2.c (do_test): Lock mutex before creating the thread.
Diffstat (limited to 'nptl/tst-basic2.c')
-rw-r--r--nptl/tst-basic2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/nptl/tst-basic2.c b/nptl/tst-basic2.c
index ffb19289b8..9bc20602d6 100644
--- a/nptl/tst-basic2.c
+++ b/nptl/tst-basic2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -58,6 +58,12 @@ do_test (void)
exit (1);
}
+ if (pthread_mutex_lock (&lock[i]) != 0)
+ {
+ puts ("mutex_lock failed");
+ exit (1);
+ }
+
if (pthread_create (&th[i], NULL, tf, (void *) i) != 0)
{
puts ("create failed");