diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-04 00:59:57 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-04 00:59:57 +0000 |
commit | 9be37ca7d51513658f5f84d98fa5e46026cc5a04 (patch) | |
tree | 5f1528e2a327b9d98b335fc2f599751a16c8c704 /include | |
parent | d47073de04f706c9d044b0fad694e5936dabc207 (diff) | |
download | ruby-9be37ca7d51513658f5f84d98fa5e46026cc5a04.tar.gz |
* thread.c (rb_wait_for_single_fd): new.
* thread.c (select_single): select(2) based backend for rb_wait_for_single_fd().
* io.c (make_writeconv): use rb_wait_for_single_fd() instaed of
rb_thread_fd_select().
* io.c (rb_io_wait_readable): ditto.
* thread.c (rb_thread_wait_fd_rw): ditto.
* io.c (wait_readable): removed.
* thread.c (init_set_fd): new helper function.
* include/ruby/io.h (RB_WAITFD_IN, RB_WAITFD_PRI, RB_WAITFD_OUT):
new constant for rb_single_wait_fd().
The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/io.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/ruby/io.h b/include/ruby/io.h index 13f42591bd..bf1b9f8b37 100644 --- a/include/ruby/io.h +++ b/include/ruby/io.h @@ -27,6 +27,10 @@ extern "C" { #include <stdio_ext.h> #endif +#define RB_WAITFD_IN 0x001 +#define RB_WAITFD_PRI 0x002 +#define RB_WAITFD_OUT 0x004 + #if defined __GNUC__ && __GNUC__ >= 4 #pragma GCC visibility push(default) #endif @@ -160,6 +164,7 @@ VALUE rb_io_get_write_io(VALUE io); VALUE rb_io_set_write_io(VALUE io, VALUE w); int rb_io_wait_readable(int); int rb_io_wait_writable(int); +int rb_wait_for_single_fd(int fd, int events, struct timeval *tv); void rb_io_set_nonblock(rb_io_t *fptr); int rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p); ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size); |