Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Nov 2010 07:33:54 +0000 (UTC)
From:      David Xu <davidxu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r215336 - head/sys/kern
Message-ID:  <201011150733.oAF7XsQ1008196@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davidxu
Date: Mon Nov 15 07:33:54 2010
New Revision: 215336
URL: http://svn.freebsd.org/changeset/base/215336

Log:
  Only unlock process if a thread is found.

Modified:
  head/sys/kern/kern_umtx.c

Modified: head/sys/kern/kern_umtx.c
==============================================================================
--- head/sys/kern/kern_umtx.c	Mon Nov 15 06:04:25 2010	(r215335)
+++ head/sys/kern/kern_umtx.c	Mon Nov 15 07:33:54 2010	(r215336)
@@ -1592,11 +1592,11 @@ umtxq_sleep_pi(struct umtx_q *uq, struct
 		/* XXX Only look up thread in current process. */
 		td1 = tdfind(owner, curproc->p_pid);
 		mtx_lock_spin(&umtx_lock);
-		if (td1 != NULL && pi->pi_owner == NULL) {
-			uq1 = td1->td_umtxq;
-			umtx_pi_setowner(pi, td1);
+		if (td1 != NULL) {
+			if (pi->pi_owner == NULL)
+				umtx_pi_setowner(pi, td1);
+			PROC_UNLOCK(td1->td_proc);
 		}
-		PROC_UNLOCK(td1->td_proc);
 	}
 
 	TAILQ_FOREACH(uq1, &pi->pi_blocked, uq_lockq) {



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