diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1264,7 +1264,7 @@ io_fflush(rb_io_t *fptr) VALUE rb_io_wait(VALUE io, VALUE events, VALUE timeout) { - VALUE scheduler = rb_thread_current_scheduler(); + VALUE scheduler = rb_scheduler_current(); if (scheduler != Qnil) { return rb_scheduler_io_wait(scheduler, io, events, timeout); @@ -1306,7 +1306,7 @@ rb_io_from_fd(int fd) int rb_io_wait_readable(int f) { - VALUE scheduler = rb_thread_current_scheduler(); + VALUE scheduler = rb_scheduler_current(); if (scheduler != Qnil) { return RTEST( rb_scheduler_io_wait_readable(scheduler, rb_io_from_fd(f)) @@ -1337,7 +1337,7 @@ rb_io_wait_readable(int f) int rb_io_wait_writable(int f) { - VALUE scheduler = rb_thread_current_scheduler(); + VALUE scheduler = rb_scheduler_current(); if (scheduler != Qnil) { return RTEST( rb_scheduler_io_wait_writable(scheduler, rb_io_from_fd(f)) @@ -1377,7 +1377,7 @@ rb_io_wait_writable(int f) int rb_wait_for_single_fd(int fd, int events, struct timeval *timeout) { - VALUE scheduler = rb_thread_current_scheduler(); + VALUE scheduler = rb_scheduler_current(); if (scheduler != Qnil) { return RTEST( @@ -1538,7 +1538,7 @@ io_binwrite(VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync) if ((n = len) <= 0) return n; - VALUE scheduler = rb_thread_current_scheduler(); + VALUE scheduler = rb_scheduler_current(); if (scheduler != Qnil && rb_scheduler_supports_io_write(scheduler)) { ssize_t length = RB_NUM2SSIZE( rb_scheduler_io_write(scheduler, fptr->self, str, offset, len) @@ -2623,7 +2623,7 @@ bufread_call(VALUE arg) static long io_fread(VALUE str, long offset, long size, rb_io_t *fptr) { - VALUE scheduler = rb_thread_current_scheduler(); + VALUE scheduler = rb_scheduler_current(); if (scheduler != Qnil && rb_scheduler_supports_io_read(scheduler)) { ssize_t length = RB_NUM2SSIZE( rb_scheduler_io_read(scheduler, fptr->self, str, offset, size) @@ -11077,7 +11077,7 @@ STATIC_ASSERT(pollout_expected, POLLOUT == RB_WAITFD_OUT); static int nogvl_wait_for_single_fd(VALUE th, int fd, short events) { - VALUE scheduler = rb_thread_scheduler_if_nonblocking(th); + VALUE scheduler = rb_thread_scheduler_current(th); if (scheduler != Qnil) { struct wait_for_single_fd args = {.scheduler = scheduler, .fd = fd, .events = events}; rb_thread_call_with_gvl(rb_thread_scheduler_wait_for_single_fd, &args); @@ -11096,7 +11096,7 @@ nogvl_wait_for_single_fd(VALUE th, int fd, short events) static int nogvl_wait_for_single_fd(VALUE th, int fd, short events) { - VALUE scheduler = rb_thread_scheduler_if_nonblocking(th); + VALUE scheduler = rb_thread_scheduler_current(th); if (scheduler != Qnil) { struct wait_for_single_fd args = {.scheduler = scheduler, .fd = fd, .events = events}; rb_thread_call_with_gvl(rb_thread_scheduler_wait_for_single_fd, &args); |