summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-10-23 17:52:49 +0000
committerjhb <jhb@FreeBSD.org>2001-10-23 17:52:49 +0000
commit972de970f5b7d3a73530169659fe3b5f09a3204c (patch)
treed636c49600612029ccf62b003275e3f7d8163b3c /sys/kern/kern_synch.c
parent13dbe953e78741613ac57ef423deb74e0d8c6e6c (diff)
downloadFreeBSD-src-972de970f5b7d3a73530169659fe3b5f09a3204c.zip
FreeBSD-src-972de970f5b7d3a73530169659fe3b5f09a3204c.tar.gz
Assert that Giant is not held in mi_switch() unless the process state
is SMTX or SRUN.
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