summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r--sys/kern/kern_synch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 348e57a..58c735e 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -701,6 +701,10 @@ mi_switch()
u_int sched_nest;
mtx_assert(&sched_lock, MA_OWNED | MA_NOTRECURSED);
+#ifdef INVARIANTS
+ if (p->p_stat != SMTX && p->p_stat != SRUN)
+ mtx_assert(&Giant, MA_NOTOWNED);
+#endif
/*
* Compute the amount of time during which the current
OpenPOWER on IntegriCloud