diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-12 05:44:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-12 05:44:23 +0000 |
commit | 58b325366dbc5c84be12fb336ee5e68f208d9365 (patch) | |
tree | e76cc28208f340b4fa1f1a126f35e5953f56e27a /ext/socket/init.c | |
parent | dda8de065c1c7691ec8627d3024a61f324bc9f73 (diff) | |
download | ruby-58b325366dbc5c84be12fb336ee5e68f208d9365.tar.gz |
* thread.c (rb_thread_io_blocking_region): new function to run
blocking region with GIL released, for fd.
* thread.c (rb_thread_fd_close): implement. [ruby-core:35203]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/init.c')
-rw-r--r-- | ext/socket/init.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/socket/init.c b/ext/socket/init.c index ebc9031150..8fa907f1dc 100644 --- a/ext/socket/init.c +++ b/ext/socket/init.c @@ -129,7 +129,7 @@ rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from) while (rb_io_check_closed(fptr), rb_thread_wait_fd(arg.fd), - (slen = BLOCKING_REGION(recvfrom_blocking, &arg)) < 0) { + (slen = BLOCKING_REGION_FD(recvfrom_blocking, &arg)) < 0) { if (!rb_io_wait_readable(fptr->fd)) { rb_sys_fail("recvfrom(2)"); } @@ -380,7 +380,7 @@ rsock_connect(int fd, const struct sockaddr *sockaddr, int len, int socks) if (socks) func = socks_connect_blocking; #endif for (;;) { - status = (int)BLOCKING_REGION(func, &arg); + status = (int)BLOCKING_REGION_FD(func, &arg); if (status < 0) { switch (errno) { case EAGAIN: @@ -515,7 +515,7 @@ rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len) arg.len = len; retry: rb_thread_wait_fd(fd); - fd2 = (int)BLOCKING_REGION(accept_blocking, &arg); + fd2 = (int)BLOCKING_REGION_FD(accept_blocking, &arg); if (fd2 < 0) { switch (errno) { case EMFILE: |