Just check p_oncpu when determining if a process is executing or not.

We already did this in the SMP case, and it is now maintained in the UP
case as well, and makes the code slightly more readable.  Note that
curproc is always executing, thus the p != curproc test does not need to
be performed if the p_oncpu check is made.
This commit is contained in:
jhb 2001-07-03 08:00:57 +00:00
parent 2c2105f43d
commit f145c527cb

View File

@ -283,10 +283,7 @@ schedcpu(arg)
p->p_estcpu = decay_cpu(loadfac, p->p_estcpu);
resetpriority(p);
if (p->p_pri.pri_level >= PUSER) {
if ((p != curproc) &&
#ifdef SMP
p->p_oncpu == NOCPU && /* idle */
#endif
if (p->p_oncpu == NOCPU && /* idle */
p->p_stat == SRUN &&
(p->p_sflag & PS_INMEM) &&
(p->p_pri.pri_level / RQ_PPQ) !=