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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 7d793de..e09a377 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -378,6 +378,13 @@ msleep(ident, mtx, priority, wmesg, timo)
int rval = 0;
WITNESS_SAVE_DECL(mtx);
+ KASSERT(ident == &proc0 || /* XXX: swapper */
+ timo != 0 || /* XXX: we might still miss a wakeup */
+ mtx_owned(&Giant) || mtx != NULL,
+ ("indefinite sleep without mutex, wmesg: \"%s\" ident: %p",
+ wmesg, ident));
+ if (mtx_owned(&vm_mtx) && mtx != &vm_mtx)
+ panic("sleeping with vm_mtx held.");
#ifdef KTRACE
if (p && KTRPOINT(p, KTR_CSW))
ktrcsw(p->p_tracep, 1, 0);
OpenPOWER on IntegriCloud