Use the passed in thread to selrecord() instead of curthread.
This commit is contained in:
parent
abd407c87b
commit
48543e9e90
@ -224,7 +224,7 @@ random_poll(dev_t dev, int events, struct thread *td)
|
||||
if (random_systat.seeded)
|
||||
revents = events & (POLLIN | POLLRDNORM);
|
||||
else
|
||||
selrecord(curthread, &random_systat.rsel);
|
||||
selrecord(td, &random_systat.rsel);
|
||||
}
|
||||
return revents;
|
||||
}
|
||||
|
@ -530,7 +530,7 @@ chn_poll(struct pcm_channel *c, int ev, struct thread *td)
|
||||
if (chn_polltrigger(c) && chn_pollreset(c))
|
||||
ret = ev;
|
||||
else
|
||||
selrecord(curthread, sndbuf_getsel(bs));
|
||||
selrecord(td, sndbuf_getsel(bs));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -562,7 +562,7 @@ usbpoll(dev, events, td)
|
||||
revents |= events & mask;
|
||||
if (revents == 0 && (events & mask)) {
|
||||
DPRINTFN(2,("usb: sleeping on %p\n", &usb_selevent));
|
||||
selrecord(curthread, &usb_selevent);
|
||||
selrecord(td, &usb_selevent);
|
||||
}
|
||||
splx(s);
|
||||
|
||||
|
@ -745,7 +745,7 @@ kqueue_poll(struct file *fp, int events, struct ucred *cred, struct thread *td)
|
||||
if (kq->kq_count) {
|
||||
revents |= events & (POLLIN | POLLRDNORM);
|
||||
} else {
|
||||
selrecord(curthread, &kq->kq_sel);
|
||||
selrecord(td, &kq->kq_sel);
|
||||
kq->kq_state |= KQ_SEL;
|
||||
}
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ logpoll(dev_t dev, int events, struct thread *td)
|
||||
if (msgbufp->msg_bufr != msgbufp->msg_bufx)
|
||||
revents |= events & (POLLIN | POLLRDNORM);
|
||||
else
|
||||
selrecord(curthread, &logsoftc.sc_selp);
|
||||
selrecord(td, &logsoftc.sc_selp);
|
||||
}
|
||||
splx(s);
|
||||
return (revents);
|
||||
|
@ -1108,12 +1108,12 @@ pipe_poll(fp, events, cred, td)
|
||||
|
||||
if (revents == 0) {
|
||||
if (events & (POLLIN | POLLRDNORM)) {
|
||||
selrecord(curthread, &rpipe->pipe_sel);
|
||||
selrecord(td, &rpipe->pipe_sel);
|
||||
rpipe->pipe_state |= PIPE_SEL;
|
||||
}
|
||||
|
||||
if (events & (POLLOUT | POLLWRNORM)) {
|
||||
selrecord(curthread, &wpipe->pipe_sel);
|
||||
selrecord(td, &wpipe->pipe_sel);
|
||||
wpipe->pipe_state |= PIPE_SEL;
|
||||
}
|
||||
}
|
||||
|
@ -1527,12 +1527,12 @@ sopoll(struct socket *so, int events, struct ucred *cred, struct thread *td)
|
||||
|
||||
if (revents == 0) {
|
||||
if (events & (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND)) {
|
||||
selrecord(curthread, &so->so_rcv.sb_sel);
|
||||
selrecord(td, &so->so_rcv.sb_sel);
|
||||
so->so_rcv.sb_flags |= SB_SEL;
|
||||
}
|
||||
|
||||
if (events & (POLLOUT | POLLWRNORM)) {
|
||||
selrecord(curthread, &so->so_snd.sb_sel);
|
||||
selrecord(td, &so->so_snd.sb_sel);
|
||||
so->so_snd.sb_flags |= SB_SEL;
|
||||
}
|
||||
}
|
||||
|
@ -990,7 +990,7 @@ bpfpoll(dev, events, td)
|
||||
if (d->bd_hlen != 0 || (d->bd_immediate && d->bd_slen != 0))
|
||||
revents |= events & (POLLIN | POLLRDNORM);
|
||||
else
|
||||
selrecord(curthread, &d->bd_sel);
|
||||
selrecord(td, &d->bd_sel);
|
||||
}
|
||||
BPFD_UNLOCK(d);
|
||||
return (revents);
|
||||
|
@ -935,7 +935,7 @@ tappoll(dev, events, td)
|
||||
TAPDEBUG("%s%d waiting for data, minor = %#x\n",
|
||||
ifp->if_name, ifp->if_unit, minor(dev));
|
||||
|
||||
selrecord(curthread, &tp->tap_rsel);
|
||||
selrecord(td, &tp->tap_rsel);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -809,7 +809,7 @@ tunpoll(dev_t dev, int events, struct thread *td)
|
||||
} else {
|
||||
TUNDEBUG("%s%d: tunpoll waiting\n", ifp->if_name,
|
||||
ifp->if_unit);
|
||||
selrecord(curthread, &tp->tun_rsel);
|
||||
selrecord(td, &tp->tun_rsel);
|
||||
}
|
||||
}
|
||||
if (events & (POLLOUT | POLLWRNORM))
|
||||
|
Loading…
Reference in New Issue
Block a user