ruby-changes:63440
From: Benoit <ko1@a...>
Date: Mon, 26 Oct 2020 16:09:16 +0900 (JST)
Subject: [ruby-changes:63440] ba24aee292 (master): Remove spec which is too difficult to get working with various compilers
https://git.ruby-lang.org/ruby.git/commit/?id=ba24aee292 From ba24aee2924dcbe1724e2d78f8b19fdede0cd95c Mon Sep 17 00:00:00 2001 From: Benoit Daloze <eregontp@g...> Date: Mon, 26 Oct 2020 08:06:33 +0100 Subject: Remove spec which is too difficult to get working with various compilers * The spec means to use an actual system library function, not a wrapper. diff --git a/spec/ruby/optional/capi/ext/thread_spec.c b/spec/ruby/optional/capi/ext/thread_spec.c index d69c463..21f98de 100644 --- a/spec/ruby/optional/capi/ext/thread_spec.c +++ b/spec/ruby/optional/capi/ext/thread_spec.c @@ -75,15 +75,6 @@ static void* blocking_gvl_func_for_udf_io(void *data) { https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/ext/thread_spec.c#L75 } } -static void* ubf_pid(void *_) { - return (void *) (SIGNED_VALUE) getpid(); -} - -static VALUE thread_spec_rb_thread_call_without_gvl_native_function(VALUE self) { - rb_pid_t ret = (rb_pid_t) (SIGNED_VALUE) rb_thread_call_without_gvl(ubf_pid, 0, RUBY_UBF_IO, 0); - return LONG2FIX(ret); -} - /* Returns true if the thread is interrupted. */ static VALUE thread_spec_rb_thread_call_without_gvl_with_ubf_io(VALUE self) { int fds[2]; @@ -145,7 +136,6 @@ void Init_thread_spec(void) { https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/ext/thread_spec.c#L136 VALUE cls = rb_define_class("CApiThreadSpecs", rb_cObject); rb_define_method(cls, "rb_thread_alone", thread_spec_rb_thread_alone, 0); rb_define_method(cls, "rb_thread_call_without_gvl", thread_spec_rb_thread_call_without_gvl, 0); - rb_define_method(cls, "rb_thread_call_without_gvl_native_function", thread_spec_rb_thread_call_without_gvl_native_function, 0); rb_define_method(cls, "rb_thread_call_without_gvl_with_ubf_io", thread_spec_rb_thread_call_without_gvl_with_ubf_io, 0); rb_define_method(cls, "rb_thread_current", thread_spec_rb_thread_current, 0); rb_define_method(cls, "rb_thread_local_aref", thread_spec_rb_thread_local_aref, 2); diff --git a/spec/ruby/optional/capi/thread_spec.rb b/spec/ruby/optional/capi/thread_spec.rb index 35b5899..df454d1 100644 --- a/spec/ruby/optional/capi/thread_spec.rb +++ b/spec/ruby/optional/capi/thread_spec.rb @@ -121,10 +121,6 @@ describe "C-API Thread function" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/thread_spec.rb#L121 thr.value.should be_true end - it "runs a native function with the global lock unlocked" do - @t.rb_thread_call_without_gvl_native_function.should == Process.pid - end - guard -> { platform_is :mingw and ruby_version_is ""..."2.7" } do it "runs a C function with the global lock unlocked and unlocks IO with the generic RUBY_UBF_IO" do thr = Thread.new do -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/