From b527b843a70b0b3e10f78ea153b5c3cf41e3dc89 Mon Sep 17 00:00:00 2001 From: Visa Hankala Date: Sun, 29 Dec 2019 07:14:07 +0000 Subject: 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@ --- sys/kern/kern_event.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/kern/kern_event.c') 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 @@ -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); -- cgit v1.2.3