* [PATCH] Fix tst-cond22.c
@ 2006-09-11 7:32 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2006-09-11 7:32 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Glibc hackers
Hi!
tst-cond22.c occassionally fails with
first thread not canceled
cond = { 0, 2, 1, 1, 1, 0x804b140, 0, 0 }
cond = { 0, 4, 2, 2, 2, 0x804b140, 0, 0 }
The problem is that it relies on tf thread not being woken up (with
pthread_signal) before pthread_cancel is run. If tf is woken before
pthread_cancel is called in the initial thread, then the thread just runs
through until return NULL; and exits.
Alternatively, we could if (res == NULL) just try again a few times and only
give up (with no error) if the "first thread" has not been successfully
cancelled for say 16 or 32 times.
2006-09-11 Jakub Jelinek <jakub@redhat.com>
* tst-cond22.c (do_test): Don't insist the first thread has to be
cancelled.
--- libc/nptl/tst-cond22.c 2006-09-11 08:56:52.000000000 +0200
+++ libc/nptl/tst-cond22.c 2006-09-11 09:22:03.000000000 +0200
@@ -94,9 +94,9 @@ do_test (void)
puts ("1st join failed");
return 1;
}
- if (res != PTHREAD_CANCELED)
+ if (res != PTHREAD_CANCELED && res != NULL)
{
- puts ("first thread not canceled");
+ puts ("first thread not canceled nor exited successfully");
status = 1;
}
Jakub
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-09-11 7:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-11 7:32 [PATCH] Fix tst-cond22.c Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).