Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 2020 01:24:45 +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-11@freebsd.org
Subject:   svn commit: r358141 - stable/11/lib/libthr/thread
Message-ID:  <202002200124.01K1OjEO086000@repo.freebsd.org>

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



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