Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/tty_info.c
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | thread_compare(struct thread *td, struct thread *td2) | ||||
if (td == NULL) | if (td == NULL) | ||||
return (1); | return (1); | ||||
/* | /* | ||||
* Fetch running stats, pctcpu usage, and interruptable flag. | * Fetch running stats, pctcpu usage, and interruptable flag. | ||||
*/ | */ | ||||
thread_lock(td); | thread_lock(td); | ||||
runa = TD_IS_RUNNING(td) | TD_ON_RUNQ(td); | runa = TD_IS_RUNNING(td) || TD_ON_RUNQ(td); | ||||
slpa = td->td_flags & TDF_SINTR; | slpa = td->td_flags & TDF_SINTR; | ||||
esta = sched_pctcpu(td); | esta = sched_pctcpu(td); | ||||
thread_unlock(td); | thread_unlock(td); | ||||
thread_lock(td2); | thread_lock(td2); | ||||
runb = TD_IS_RUNNING(td2) | TD_ON_RUNQ(td2); | runb = TD_IS_RUNNING(td2) || TD_ON_RUNQ(td2); | ||||
estb = sched_pctcpu(td2); | estb = sched_pctcpu(td2); | ||||
slpb = td2->td_flags & TDF_SINTR; | slpb = td2->td_flags & TDF_SINTR; | ||||
thread_unlock(td2); | thread_unlock(td2); | ||||
/* | /* | ||||
* see if at least one of them is runnable | * see if at least one of them is runnable | ||||
*/ | */ | ||||
switch (TESTAB(runa, runb)) { | switch (TESTAB(runa, runb)) { | ||||
case ONLYA: | case ONLYA: | ||||
▲ Show 20 Lines • Show All 269 Lines • Show Last 20 Lines |