diff --git a/load.c b/load.c index 3cf9ce0aba..c37f8bcf0b 100644 --- a/load.c +++ b/load.c @@ -745,9 +745,6 @@ load_lock(const char *ftptr) } switch (rb_thread_shield_wait((VALUE)data)) { case Qfalse: - data = (st_data_t)ftptr; - st_insert(loading_tbl, data, (st_data_t)rb_thread_shield_new()); - return 0; case Qnil: return 0; } @@ -759,7 +756,10 @@ release_thread_shield(st_data_t *key, st_data_t *value, st_data_t done, int exis { VALUE thread_shield = (VALUE)*value; if (!existing) return ST_STOP; - if (done ? rb_thread_shield_destroy(thread_shield) : rb_thread_shield_release(thread_shield)) { + if (done) { + rb_thread_shield_destroy(thread_shield); + } + else if (rb_thread_shield_release(thread_shield)) { /* still in-use */ return ST_CONTINUE; } diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index cc18bf06b8..7b5b79d862 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -697,9 +697,9 @@ class TestRequire < Test::Unit::TestCase bug7530 = '[ruby-core:50645]' Tempfile.create(%w'bug-7530- .rb') {|script| script.close - assert_in_out_err([{"RUBYOPT" => nil}, "-", script.path], <<-INPUT, %w(:ok), [], bug7530, timeout: 20) + assert_in_out_err([{"RUBYOPT" => nil}, "-", script.path], <<-INPUT, %w(:ok), [], bug7530, timeout: 40) PATH = ARGV.shift - THREADS = 2 + THREADS = 4 ITERATIONS_PER_THREAD = 1000 THREADS.times.map {