--- //depot/projects/smpng/sys/kern/kern_thread.c 2005/09/30 17:46:19 +++ //depot/user/jhb/preemption/kern/kern_thread.c 2005/09/30 18:17:36 @@ -948,9 +948,11 @@ mtx_assert(&sched_lock, MA_OWNED); PROC_LOCK_ASSERT(p, MA_OWNED); if (!P_SHOULDSTOP(p)) { + critical_enter(); while ((td = TAILQ_FIRST(&p->p_suspended))) { thread_unsuspend_one(td); } + critical_exit(); } else if ((P_SHOULDSTOP(p) == P_STOPPED_SINGLE) && (p->p_numthreads == p->p_suspcount)) { /* @@ -985,9 +987,11 @@ * to continue however as this is a bad place to stop. */ if ((p->p_numthreads != 1) && (!P_SHOULDSTOP(p))) { + critical_enter(); while ((td = TAILQ_FIRST(&p->p_suspended))) { thread_unsuspend_one(td); } + critical_exit(); } mtx_unlock_spin(&sched_lock); } --- //depot/projects/smpng/sys/vm/vm_glue.c 2005/05/27 14:58:46 +++ //depot/user/jhb/preemption/vm/vm_glue.c 2005/05/27 19:03:12 @@ -556,6 +556,7 @@ vm_thread_swapin(td); PROC_LOCK(p); + critical_enter(); mtx_lock_spin(&sched_lock); p->p_sflag &= ~PS_SWAPPINGIN; p->p_sflag |= PS_INMEM; @@ -570,6 +571,7 @@ /* Allow other threads to swap p out now. */ --p->p_lock; + critical_exit(); } #endif /* NO_SWAPPING */ }