1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/basicsocket.c (rsock_bsock_send):

avoid unnecessary select() calls before doing I/O
  Patch by Eric Wong. [Feature #4538] [ruby-core:35586]
* ext/socket/init.c (rsock_s_recvfrom): ditto.
* ext/socket/init.c (rsock_s_accept): ditto.
* ext/socket/udpsocket.c (udp_send): ditto.
* io.c (io_fflush): ditto.
* io.c (io_binwrite): ditto.
* io.c (rb_io_syswrite): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2012-09-09 17:29:12 +00:00
parent 946f7fc788
commit 84c77c1520
5 changed files with 22 additions and 17 deletions

View file

@ -558,8 +558,7 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
GetOpenFile(sock, fptr);
arg.fd = fptr->fd;
arg.flags = NUM2INT(flags);
while (rb_thread_fd_writable(arg.fd),
(n = (int)BLOCKING_REGION_FD(func, &arg)) < 0) {
while ((n = (int)BLOCKING_REGION_FD(func, &arg)) < 0) {
if (rb_io_wait_writable(arg.fd)) {
continue;
}