summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_turnstile.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2012-08-22 20:01:38 +0000
committerjhb <jhb@FreeBSD.org>2012-08-22 20:01:38 +0000
commitca55558465e9647d883f38cb1f9639bb60c3a161 (patch)
tree7151d359ad426acc299ded840b3ca451ffe110b7 /sys/kern/subr_turnstile.c
parent9559a94c6bd31513aa1c178aed9fd5ee20d0186f (diff)
downloadFreeBSD-src-ca55558465e9647d883f38cb1f9639bb60c3a161.zip
FreeBSD-src-ca55558465e9647d883f38cb1f9639bb60c3a161.tar.gz
Mark the idle threads as non-sleepable and also assert that an idle
thread never blocks on a turnstile.
Diffstat (limited to 'sys/kern/subr_turnstile.c')
-rw-r--r--sys/kern/subr_turnstile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c
index 76fb964..31d16fe 100644
--- a/sys/kern/subr_turnstile.c
+++ b/sys/kern/subr_turnstile.c
@@ -684,6 +684,7 @@ turnstile_wait(struct turnstile *ts, struct thread *owner, int queue)
if (owner)
MPASS(owner->td_proc->p_magic == P_MAGIC);
MPASS(queue == TS_SHARED_QUEUE || queue == TS_EXCLUSIVE_QUEUE);
+ KASSERT(!TD_IS_IDLETHREAD(td), ("idle threads cannot block on locks"));
/*
* If the lock does not already have a turnstile, use this thread's
OpenPOWER on IntegriCloud