summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2009-06-04 04:26:54 +0000
committerbeck <beck@openbsd.org>2009-06-04 04:26:54 +0000
commit689eb2cda2769d1d35f4e7844298b8129897ba94 (patch)
treec73149fed57c85f472e657f0c443502a0827c8ce
parentenable IPv6 receive TCP/UDP checksum offload for the 5755 and later chips; (diff)
downloadwireguard-openbsd-689eb2cda2769d1d35f4e7844298b8129897ba94.tar.xz
wireguard-openbsd-689eb2cda2769d1d35f4e7844298b8129897ba94.zip
unfuck msleep - fixed by art and ariane after much horror and teeth gnashing
over why the processes were being woken up at splvm after the page daemon ran - and probably also had the page daemon running at splvm after the first pass through the loop. ok art@ weingart@ oga@ ariane@
-rw-r--r--sys/kern/kern_synch.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 612718375b6..eb9d2f9dafa 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_synch.c,v 1.90 2009/06/02 23:05:31 guenther Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.91 2009/06/04 04:26:54 beck Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*
@@ -165,9 +165,12 @@ msleep(const volatile void *ident, struct mutex *mtx, int priority,
error1 = sleep_finish_timeout(&sls);
error = sleep_finish_signal(&sls);
- if (mtx && (priority & PNORELOCK) == 0) {
- mtx_enter(mtx);
- MUTEX_OLDIPL(mtx) = spl; /* put the ipl back */
+ if (mtx) {
+ if ((priority & PNORELOCK) == 0) {
+ mtx_enter(mtx);
+ MUTEX_OLDIPL(mtx) = spl; /* put the ipl back */
+ } else
+ splx(spl);
}
/* Signal errors are higher priority than timeouts. */
if (error == 0 && error1 != 0)