1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

unlock global lock in kqueue_scan before msleep'ing to prevent dead

lock..  we didn't unlock global lock earlier to prevent just having
to reaquire it again..

Found by:	peter
Reviewed by:	ps
MFC after:	3 days
This commit is contained in:
John-Mark Gurney 2004-09-14 18:38:16 +00:00
parent f9963bbc08
commit 31580e6817
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135240

View File

@ -1104,6 +1104,7 @@ kqueue_scan(struct kqueue *kq, int maxevents, struct kevent *ulistp,
if (timeout < 0) {
error = EWOULDBLOCK;
} else {
KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal);
kq->kq_state |= KQ_SLEEP;
error = msleep(kq, &kq->kq_lock, PSOCK | PCATCH,
"kqread", timeout);
@ -1125,6 +1126,7 @@ kqueue_scan(struct kqueue *kq, int maxevents, struct kevent *ulistp,
if ((kn->kn_status == KN_MARKER && kn != marker) ||
(kn->kn_status & KN_INFLUX) == KN_INFLUX) {
KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal);
kq->kq_state |= KQ_FLUXWAIT;
error = msleep(kq, &kq->kq_lock, PSOCK,
"kqflxwt", 0);