diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2019-12-29 07:14:07 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2019-12-29 07:14:07 +0000 |
commit | b527b843a70b0b3e10f78ea153b5c3cf41e3dc89 (patch) | |
tree | eae3aee1c27b3e9172ce58b2046c57e0a56fe795 /sys/kern/kern_event.c | |
parent | 236e94eabe6de38362332b8d8f3bcd5aa7b2df44 (diff) |
Wake up knote waiters in knote_drop(). This lets the blocked
knote_acquire() calls resume immediately instead of waiting
for the timeout expiry.
OK anton@, tedu@
Diffstat (limited to 'sys/kern/kern_event.c')
-rw-r--r-- | sys/kern/kern_event.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 0b6d94d6e4f..fd6876626b2 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.110 2019/12/25 15:04:44 visa Exp $ */ +/* $OpenBSD: kern_event.c,v 1.111 2019/12/29 07:14:06 visa Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> @@ -1153,6 +1153,10 @@ knote_drop(struct knote *kn, struct proc *p) SLIST_REMOVE(list, kn, knote, kn_link); if (kn->kn_status & KN_QUEUED) knote_dequeue(kn); + if (kn->kn_status & KN_WAITING) { + kn->kn_status &= ~KN_WAITING; + wakeup(kn); + } if (kn->kn_fop->f_isfd) FRELE(kn->kn_fp, p); pool_put(&knote_pool, kn); |