diff options
author | jhb <jhb@FreeBSD.org> | 2001-05-15 23:15:06 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-05-15 23:15:06 +0000 |
commit | 1ee607ffeaad3279ffc4c0d1e6641020e9762673 (patch) | |
tree | 731413f07592169058fb925c532dcfb000f1f7d6 /sys/kern | |
parent | 36dcd7aa2fee5c973cc58fcbd508631d333fb4aa (diff) | |
download | FreeBSD-src-1ee607ffeaad3279ffc4c0d1e6641020e9762673.zip FreeBSD-src-1ee607ffeaad3279ffc4c0d1e6641020e9762673.tar.gz |
- Remove unneeded include of sys/ipl.h.
- Lock the process before calling killproc() to kill it for exceeding the
maximum CPU limit.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_synch.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index dc8d25a..7d793de 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -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); |