- Call sched_sleep() before we suspend threads. sched_wakeup() is already

called via setrunnable().  This allows time slept while suspended to
   be accounted for swap.

Approved by:	re
This commit is contained in:
Jeff Roberson 2007-09-21 04:04:22 +00:00
parent d332abbac7
commit f462501739

View File

@ -852,6 +852,7 @@ thread_suspend_switch(struct thread *td)
p->p_suspcount++;
PROC_UNLOCK(p);
thread_lock(td);
sched_sleep(td);
TD_SET_SUSPENDED(td);
PROC_SUNLOCK(p);
DROP_GIANT();
@ -871,6 +872,7 @@ thread_suspend_one(struct thread *td)
THREAD_LOCK_ASSERT(td, MA_OWNED);
KASSERT(!TD_IS_SUSPENDED(td), ("already suspended"));
p->p_suspcount++;
sched_sleep(td);
TD_SET_SUSPENDED(td);
}