ruby-changes:59154
From: Nobuyoshi <ko1@a...>
Date: Tue, 10 Dec 2019 16:06:56 +0900 (JST)
Subject: [ruby-changes:59154] f9c0fe77c0 (master): [ruby/io-console] Use rb_thread_call_without_gvl instead of the deprecated function
https://git.ruby-lang.org/ruby.git/commit/?id=f9c0fe77c0 From f9c0fe77c0ef6c5da1d8454bf6be6841c984d606 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 10 Dec 2019 10:09:33 +0900 Subject: [ruby/io-console] Use rb_thread_call_without_gvl instead of the deprecated function https://github.com/ruby/io-console/commit/21338ab287 diff --git a/ext/io/console/console.c b/ext/io/console/console.c index 626d8d7..b83fb67 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -4,6 +4,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L4 */ #include "ruby.h" #include "ruby/io.h" +#include "ruby/thread.h" #ifdef HAVE_UNISTD_H #include <unistd.h> @@ -454,7 +455,7 @@ getc_call(VALUE io) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L455 return rb_funcallv(io, id_getc, 0, 0); } #else -static VALUE +static void * nogvl_getch(void *p) { int len = 0; @@ -473,7 +474,7 @@ nogvl_getch(void *p) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L474 buf[len++] = c; break; } - return (VALUE)len; + return (void *)(VALUE)len; } #endif @@ -521,7 +522,7 @@ console_getch(int argc, VALUE *argv, VALUE io) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L522 rb_warning("vtime option ignored if intr flag is unset"); } } - len = (int)rb_thread_io_blocking_region(nogvl_getch, wbuf, fptr->fd); + len = (int)(VALUE)rb_thread_call_without_gvl(nogvl_getch, wbuf, RUBY_UBF_IO, 0); switch (len) { case 0: return Qnil; -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/