This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]