summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2022-11-09 22:25:37 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2022-11-09 22:25:37 +0000
commitab58bd62db4be91d44adaac66a8a1e4b2a62d116 (patch)
tree6c881db264b621c8f9fccc26fea25be23d059f97 /sys
parent69dbc7b5f9585168eb4962a531f39d27276c4e97 (diff)
Remove kernel lock here since msleep() with PCATCH no longer requires it.
OK mpi@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_event.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 159531d30e9..388691ee69d 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_event.c,v 1.193 2022/08/14 01:58:27 jsg Exp $ */
+/* $OpenBSD: kern_event.c,v 1.194 2022/11/09 22:25:36 claudio Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@@ -1287,14 +1287,10 @@ retry:
error = 0;
reinserted = 0;
- /* msleep() with PCATCH requires kernel lock. */
- KERNEL_LOCK();
-
mtx_enter(&kq->kq_lock);
if (kq->kq_state & KQ_DYING) {
mtx_leave(&kq->kq_lock);
- KERNEL_UNLOCK();
error = EBADF;
goto done;
}
@@ -1307,14 +1303,12 @@ retry:
if ((tsp != NULL && !timespecisset(tsp)) ||
scan->kqs_nevent != 0) {
mtx_leave(&kq->kq_lock);
- KERNEL_UNLOCK();
error = 0;
goto done;
}
kq->kq_state |= KQ_SLEEP;
error = kqueue_sleep(kq, tsp);
/* kqueue_sleep() has released kq_lock. */
- KERNEL_UNLOCK();
if (error == 0 || error == EWOULDBLOCK)
goto retry;
/* don't restart after signals... */
@@ -1323,9 +1317,6 @@ retry:
goto done;
}
- /* The actual scan does not sleep on kq, so unlock the kernel. */
- KERNEL_UNLOCK();
-
/*
* Put the end marker in the queue to limit the scan to the events
* that are currently active. This prevents events from being