summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_event.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 57b508d46f7..ea7622cd05f 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_event.c,v 1.102 2019/05/01 06:22:39 dlg Exp $ */
+/* $OpenBSD: kern_event.c,v 1.103 2019/05/04 14:42:44 mpi Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@@ -1073,7 +1073,10 @@ knote_enqueue(struct knote *kn)
int s = splhigh();
KASSERT((kn->kn_status & KN_QUEUED) == 0);
- KERNEL_ASSERT_LOCKED();
+#ifdef DIAGNOSTIC
+ if (!_kernel_lock_held() && (splassert_ctl > 0))
+ splassert_fail(42, 0, __func__);
+#endif
TAILQ_INSERT_TAIL(&kq->kq_head, kn, kn_tqe);
kn->kn_status |= KN_QUEUED;
@@ -1089,7 +1092,10 @@ knote_dequeue(struct knote *kn)
int s = splhigh();
KASSERT(kn->kn_status & KN_QUEUED);
- KERNEL_ASSERT_LOCKED();
+#ifdef DIAGNOSTIC
+ if (!_kernel_lock_held() && (splassert_ctl > 0))
+ splassert_fail(42, 0, __func__);
+#endif
TAILQ_REMOVE(&kq->kq_head, kn, kn_tqe);
kn->kn_status &= ~KN_QUEUED;