From 627ed43ba72b8b54853428ebdb5d37954053088d Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 17 Jul 2002 02:46:13 +0000 Subject: [PATCH] Add a KASSERT() to assert that td_critnest is == 1 when mi_switch() is called. --- sys/kern/kern_synch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index f54c2d1700bb..499b5d105b54 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -796,6 +796,8 @@ mi_switch() td->td_state != TDS_RUNNING) mtx_assert(&Giant, MA_NOTOWNED); #endif + KASSERT(td->td_critnest == 1, + ("mi_switch: switch in a critical section")); /* * Compute the amount of time during which the current