From 09108003723924826eb0915209f83a30f66d15ca Mon Sep 17 00:00:00 2001 From: ad Date: Tue, 29 Apr 2008 13:56:14 +0000 Subject: [PATCH] Suspended LWPs are no longer created with l_mutex == spc_mutex. Remove workaround in setrunnable. Fixes PR kern/38222. --- sys/kern/kern_synch.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index a9b9a13b1e0a..e2e775624e00 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_synch.c,v 1.235 2008/04/28 22:15:47 ad Exp $ */ +/* $NetBSD: kern_synch.c,v 1.236 2008/04/29 13:56:14 ad Exp $ */ /*- * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -94,7 +94,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.235 2008/04/28 22:15:47 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.236 2008/04/29 13:56:14 ad Exp $"); #include "opt_kstack.h" #include "opt_lockdebug.h" @@ -949,10 +949,8 @@ setrunnable(struct lwp *l) */ ci = sched_takecpu(l); l->l_cpu = ci; - if (l->l_mutex != l->l_cpu->ci_schedstate.spc_mutex) { - lwp_unlock_to(l, ci->ci_schedstate.spc_mutex); - lwp_lock(l); - } + spc_lock(ci); + lwp_unlock_to(l, ci->ci_schedstate.spc_mutex); sched_setrunnable(l); l->l_stat = LSRUN; l->l_slptime = 0;