mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Slide socket buffer lock earlier in sopoll() to cover the call into
selrecord(), setting up select and flagging the socker buffers as SB_SEL and setting up select under the lock.
This commit is contained in:
parent
80f0e4c265
commit
adb4cf0fbc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131005
@ -1884,15 +1884,15 @@ sopoll(struct socket *so, int events, struct ucred *active_cred,
|
||||
if (events &
|
||||
(POLLIN | POLLINIGNEOF | POLLPRI | POLLRDNORM |
|
||||
POLLRDBAND)) {
|
||||
selrecord(td, &so->so_rcv.sb_sel);
|
||||
SOCKBUF_LOCK(&so->so_rcv);
|
||||
selrecord(td, &so->so_rcv.sb_sel);
|
||||
so->so_rcv.sb_flags |= SB_SEL;
|
||||
SOCKBUF_UNLOCK(&so->so_rcv);
|
||||
}
|
||||
|
||||
if (events & (POLLOUT | POLLWRNORM)) {
|
||||
selrecord(td, &so->so_snd.sb_sel);
|
||||
SOCKBUF_LOCK(&so->so_snd);
|
||||
selrecord(td, &so->so_snd.sb_sel);
|
||||
so->so_snd.sb_flags |= SB_SEL;
|
||||
SOCKBUF_UNLOCK(&so->so_snd);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user