Make sure to wake up any select waiters when closing a kqueue (also, not
crash). I am fairly sure that only people with SMP and multi-threaded apps using kqueue will be affected by this, so I have a stress-testing program on my web site: <URL:http://green.homeunix.org/~green/getaddrinfo-pthreads-stresstest.c>
This commit is contained in:
parent
6b582d5433
commit
fe5f3a72ac
@ -902,6 +902,10 @@ kqueue_close(struct file *fp, struct thread *td)
|
||||
}
|
||||
}
|
||||
FILEDESC_UNLOCK(fdp);
|
||||
if (kq->kq_state & KQ_SEL) {
|
||||
kq->kq_state &= ~KQ_SEL;
|
||||
selwakeuppri(&kq->kq_sel, PSOCK);
|
||||
}
|
||||
free(kq, M_KQUEUE);
|
||||
fp->f_data = NULL;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user