diff options
author | jmg <jmg@FreeBSD.org> | 2004-09-14 18:38:16 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 2004-09-14 18:38:16 +0000 |
commit | ab707546058bb623961fde06996cfcadcdd408dd (patch) | |
tree | 424ff574d5cb8287f9932f4c6ffd5d7fe77f630d /sys | |
parent | f129890dbf243461b280ab5ae875b6161126e0b3 (diff) | |
download | FreeBSD-src-ab707546058bb623961fde06996cfcadcdd408dd.zip FreeBSD-src-ab707546058bb623961fde06996cfcadcdd408dd.tar.gz |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_event.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 8c98538..59a00ee 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1104,6 +1104,7 @@ start: 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 @@ start: 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); |