This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] don't check error return for pthread_cancel in tst-cond25
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 17 Oct 2012 14:24:30 +0530
- Subject: [PATCH] don't check error return for pthread_cancel in tst-cond25
Hi,
The tst-cond25 test case I had put in had a check for return value of
pthread_cancel and a subsequent failure if it is non-zero. This is
wrong since the thread being cancelled could have exited by the time it
was cancelled. Attached patch removes the check. OK to commit?
Siddhesh
nptl/ChangeLog:
* tst-cond25 (do_test_wait): Don't check for return value from
pthread_cancel.
diff --git a/nptl/tst-cond25.c b/nptl/tst-cond25.c
index 4488e74..370cd67 100644
--- a/nptl/tst-cond25.c
+++ b/nptl/tst-cond25.c
@@ -228,11 +228,7 @@ do_test_wait (thr_func f)
for (j = 0; j < NUM; j++)
{
- if ((ret = pthread_cancel (w[j])) != 0)
- {
- printf ("waiter[%d]: cancel failed: %s\n", j, strerror (ret));
- goto out;
- }
+ pthread_cancel (w[j]);
if ((ret = pthread_join (w[j], &thr_ret)) != 0)
{