diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-08-01 06:49:07 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-01 06:49:07 +0900 |
commit | 3b52230452980f3afc6a7380276ea62f7c65e517 (patch) | |
tree | 51b1529d7a8897be325545d532e2f317f1dc0241 /io.c | |
parent | 242f024bcbff6c46edd84a03365fa99ebd8eb524 (diff) |
Define functions using rb_wait_for_single_fd [Bug #18046]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4696
Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1408,6 +1408,18 @@ rb_wait_for_single_fd(int fd, int events, struct timeval *timeout) return io_wait_for_single_fd(fd, events, timeout); } +int +rb_thread_wait_fd(int fd) +{ + return rb_wait_for_single_fd(fd, RUBY_IO_READABLE, NULL); +} + +int +rb_thread_fd_writable(int fd) +{ + return rb_wait_for_single_fd(fd, RUBY_IO_WRITABLE, NULL); +} + VALUE rb_io_maybe_wait(int error, VALUE io, VALUE events, VALUE timeout) { switch (error) { |