Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Sep 2019 20:06:36 +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: r351790 - stable/12/sys/kern
Message-ID:  <201909032006.x83K6aQ5082516@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Sep  3 20:06:36 2019
New Revision: 351790
URL: https://svnweb.freebsd.org/changeset/base/351790

Log:
  MFC r350502:
  Make umtxq_check_susp() to correctly handle thread exit requests.

Modified:
  stable/12/sys/kern/kern_umtx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_umtx.c
==============================================================================
--- stable/12/sys/kern/kern_umtx.c	Tue Sep  3 20:04:44 2019	(r351789)
+++ stable/12/sys/kern/kern_umtx.c	Tue Sep  3 20:06:36 2019	(r351790)
@@ -723,13 +723,11 @@ umtxq_check_susp(struct thread *td, bool sleep)
 	error = 0;
 	p = td->td_proc;
 	PROC_LOCK(p);
-	if (P_SHOULDSTOP(p) ||
-	    ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND))) {
-		if (p->p_flag & P_SINGLE_EXIT)
-			error = EINTR;
-		else
-			error = sleep ? thread_suspend_check(0) : ERESTART;
-	}
+	if (p->p_flag & P_SINGLE_EXIT)
+		error = EINTR;
+	else if (P_SHOULDSTOP(p) ||
+	    ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND)))
+		error = sleep ? thread_suspend_check(0) : ERESTART;
 	PROC_UNLOCK(p);
 	return (error);
 }



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