summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-10-20 19:55:21 +0000
committerjeff <jeff@FreeBSD.org>2003-10-20 19:55:21 +0000
commitd477fdf956008182b20cd96c718f3410a088597b (patch)
treee7ecdac1f807283a2266afcc9b3152a4309e7ce5 /sys
parent431652ca1fb84cfea2aafad15915d6105016d79d (diff)
downloadFreeBSD-src-d477fdf956008182b20cd96c718f3410a088597b.zip
FreeBSD-src-d477fdf956008182b20cd96c718f3410a088597b.tar.gz
- If a thread is not bound to a kse return 0 from sched_pctcpu().
Reported by: pawel.worach@nordea.com
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sched_ule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index 1f79439..ccd7bdd 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -1311,6 +1311,8 @@ sched_pctcpu(struct thread *td)
pctcpu = 0;
ke = td->td_kse;
+ if (ke == NULL)
+ return (0);
mtx_lock_spin(&sched_lock);
if (ke->ke_ticks) {
OpenPOWER on IntegriCloud