thread.c (rb_wait_for_single_fd): no point initializing pollfd.revents
poll(2) and ppoll(2) implementations need to check and write to .revents on the initial scan, anyways. So any poll/ppoll call which returns a positive result can be expected to have an initialized .revents value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
de75372029
commit
c076d6009c
3
thread.c
3
thread.c
@ -4043,12 +4043,10 @@ rb_wait_for_single_fd(int fd, int events, struct timeval *timeout)
|
|||||||
fds[0].fd = fd;
|
fds[0].fd = fd;
|
||||||
fds[0].events = (short)events;
|
fds[0].events = (short)events;
|
||||||
do {
|
do {
|
||||||
fds[0].revents = 0;
|
|
||||||
fds[1].fd = rb_sigwait_fd_get(th);
|
fds[1].fd = rb_sigwait_fd_get(th);
|
||||||
|
|
||||||
if (fds[1].fd >= 0) {
|
if (fds[1].fd >= 0) {
|
||||||
fds[1].events = POLLIN;
|
fds[1].events = POLLIN;
|
||||||
fds[1].revents = 0;
|
|
||||||
nfds = 2;
|
nfds = 2;
|
||||||
ubf = ubf_sigwait;
|
ubf = ubf_sigwait;
|
||||||
}
|
}
|
||||||
@ -4072,7 +4070,6 @@ rb_wait_for_single_fd(int fd, int events, struct timeval *timeout)
|
|||||||
if (fds[1].fd >= 0) {
|
if (fds[1].fd >= 0) {
|
||||||
if (result > 0 && fds[1].revents) {
|
if (result > 0 && fds[1].revents) {
|
||||||
result--;
|
result--;
|
||||||
fds[1].revents = 0;
|
|
||||||
}
|
}
|
||||||
(void)check_signals_nogvl(th, fds[1].fd);
|
(void)check_signals_nogvl(th, fds[1].fd);
|
||||||
rb_sigwait_fd_put(th, fds[1].fd);
|
rb_sigwait_fd_put(th, fds[1].fd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user