diff options
author | davidxu <davidxu@FreeBSD.org> | 2010-11-15 07:33:54 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2010-11-15 07:33:54 +0000 |
commit | 27725d83cceb418509558e9041d5b1caf8ad3e38 (patch) | |
tree | d3a5a21ef84706dd9b55def0b4f81f97ddaad70d /sys | |
parent | fb08b6b067d9fc055ccb04ae52657e2b2f53ddbf (diff) | |
download | FreeBSD-src-27725d83cceb418509558e9041d5b1caf8ad3e38.zip FreeBSD-src-27725d83cceb418509558e9041d5b1caf8ad3e38.tar.gz |
Only unlock process if a thread is found.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_umtx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index cf8c534..951fef6 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -1592,11 +1592,11 @@ umtxq_sleep_pi(struct umtx_q *uq, struct umtx_pi *pi, /* 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) { |