diff options
author | John Baldwin <jhb@FreeBSD.org> | 2001-03-09 03:59:50 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2001-03-09 03:59:50 +0000 |
commit | 3a3f6082886850e43ee17c5c4ec73e702c4640f8 (patch) | |
tree | ceaa6c013a774fc69e062615df44ce56b2669f27 /sys/kern/kern_switch.c | |
parent | 2e5fc9fd7e6a10e8a3eadc6a929291ba18d32472 (diff) | |
download | src-3a3f6082886850e43ee17c5c4ec73e702c4640f8.tar.gz src-3a3f6082886850e43ee17c5c4ec73e702c4640f8.zip |
Add a new informative KASSERT to ensure that a process is in the SRUN state
before we return it to cpu_switch().
Notes
Notes:
svn path=/head/; revision=74014
Diffstat (limited to 'sys/kern/kern_switch.c')
-rw-r--r-- | sys/kern/kern_switch.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index bfe0e7f0f9dd..0dd8538a2561 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -190,6 +190,9 @@ runq_choose(struct runq *rq) rqh = &rq->rq_queues[pri]; p = TAILQ_FIRST(rqh); KASSERT(p != NULL, ("runq_choose: no proc on busy queue")); + KASSERT(p->p_stat == SRUN, + ("runq_chose: process %d(%s) in state %d", p->p_pid, + p->p_comm, p->p_stat)); CTR3(KTR_RUNQ, "runq_choose: pri=%d p=%p rqh=%p", pri, p, rqh); TAILQ_REMOVE(rqh, p, p_procq); if (TAILQ_EMPTY(rqh)) { |