Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 2020 01:23:40 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r358140 - stable/12/lib/libthr/thread
Message-ID:  <202002200123.01K1NeQM085892@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002200123.01K1NeQM085892>