svn commit: r358141 - stable/11/lib/libthr/thread

Konstantin Belousov kib at FreeBSD.org
Thu Feb 20 01:24:46 UTC 2020


Author: kib
Date: Thu Feb 20 01:24:45 2020
New Revision: 358141
URL: https://svnweb.freebsd.org/changeset/base/358141

Log:
  MFC r357894:
  Return success, instead of ESRCH, from pthread_cancel(3) applied to the
  exited but not yet joined thread.

Modified:
  stable/11/lib/libthr/thread/thr_cancel.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libthr/thread/thr_cancel.c
==============================================================================
--- stable/11/lib/libthr/thread/thr_cancel.c	Thu Feb 20 01:23:39 2020	(r358140)
+++ stable/11/lib/libthr/thread/thr_cancel.c	Thu Feb 20 01:24:45 2020	(r358141)
@@ -63,7 +63,7 @@ _pthread_cancel(pthread_t pthread)
 	 * _thr_find_thread and THR_THREAD_UNLOCK will enter and leave critical
 	 * region automatically.
 	 */
-	if ((ret = _thr_find_thread(curthread, pthread, 0)) == 0) {
+	if ((ret = _thr_find_thread(curthread, pthread, 1)) == 0) {
 		if (!pthread->cancel_pending) {
 			pthread->cancel_pending = 1;
 			if (pthread->state != PS_DEAD)


More information about the svn-src-stable-11 mailing list