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:
Brian Feldman 2004-02-20 04:00:48 +00:00
parent 6b582d5433
commit fe5f3a72ac

View File

@ -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;