From a08ee8330d3d739467bfa34deeb797d83e59ed3c Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Fri, 16 Oct 2020 14:25:58 +1300 Subject: Rename to `Fiber#set_scheduler`. --- io.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 5b3893f64d..95a4c7d35e 100644 --- a/io.c +++ b/io.c @@ -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); -- cgit v1.2.3