summaryrefslogtreecommitdiff
path: root/sys/kern/subr_sleepqueue.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2005-09-15 19:05:37 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2005-09-15 19:05:37 +0000
commit51460da87f8a306a9557071cb37cececea613edc (patch)
tree1a97be74d31fd11ae0c4179f921efa5d4a11fa7a /sys/kern/subr_sleepqueue.c
parentb7b51ed01dae1eb52d133cdc2833779e17a40f87 (diff)
Notes
Diffstat (limited to 'sys/kern/subr_sleepqueue.c')
-rw-r--r--sys/kern/subr_sleepqueue.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c
index 44a2596d29e6..3def26335a01 100644
--- a/sys/kern/subr_sleepqueue.c
+++ b/sys/kern/subr_sleepqueue.c
@@ -269,6 +269,10 @@ sleepq_add(void *wchan, struct mtx *lock, const char *wmesg, int flags)
MPASS(td->td_sleepqueue != NULL);
MPASS(wchan != NULL);
+ /* If this thread is not allowed to sleep, die a horrible death. */
+ KASSERT(!(td->td_pflags & TDP_NOSLEEPING),
+ ("trying to sleep while sleeping is prohibited"));
+
/* Look up the sleep queue associated with the wait channel 'wchan'. */
sq = sleepq_lookup(wchan);