svn commit: r358140 - stable/12/lib/libthr/thread

Konstantin Belousov kib at FreeBSD.org
Thu Feb 20 01:23:41 UTC 2020


Author: kib
Date: Thu Feb 20 01:23:39 2020
New Revision: 358140
URL: https://svnweb.freebsd.org/changeset/base/358140

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

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

Modified: stable/12/lib/libthr/thread/thr_cancel.c
==============================================================================
--- stable/12/lib/libthr/thread/thr_cancel.c	Thu Feb 20 01:22:09 2020	(r358139)
+++ stable/12/lib/libthr/thread/thr_cancel.c	Thu Feb 20 01:23:39 2020	(r358140)
@@ -71,7 +71,7 @@ _thr_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 mailing list