- Remove unneeded include of sys/ipl.h.

- Lock the process before calling killproc() to kill it for exceeding the
  maximum CPU limit.
This commit is contained in:
John Baldwin 2001-05-15 23:15:06 +00:00
parent 9081e5e826
commit 74fc745594

View File

@ -44,7 +44,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/condvar.h>
#include <sys/ipl.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/lock.h>
@ -885,8 +884,10 @@ mi_switch()
rlim = &p->p_rlimit[RLIMIT_CPU];
if (p->p_runtime / (rlim_t)1000000 >= rlim->rlim_max) {
mtx_unlock_spin(&sched_lock);
PROC_LOCK(p);
killproc(p, "exceeded maximum CPU limit");
mtx_lock_spin(&sched_lock);
PROC_UNLOCK_NOSWITCH(p);
} else {
mtx_unlock_spin(&sched_lock);
PROC_LOCK(p);