From bc0577c6c8607d57a13282a34c80f64fe9bf1eef Mon Sep 17 00:00:00 2001 From: glass Date: Wed, 9 Jan 2013 00:59:30 +0000 Subject: * load.c (load_lock): fix not to delete thread shield twice. it may break the shield locked by another thread. [Bug #7530] [ruby-core:50645] * test/ruby/test_require.rb: a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_require.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 410edbb276..1ff2d78697 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -604,4 +604,25 @@ class TestRequire < Test::Unit::TestCase } } end + + def test_require_with_loaded_features_pop + bug7530 = '[ruby-core:50645]' + assert_in_out_err([], <<-INPUT, %w(:ok), [], bug7530) + THREADS = 2 + ITERATIONS_PER_THREAD = 1000 + + $: << '.' + system 'touch __load_path_bench_script__.rb' + THREADS.times.map { + Thread.new do + ITERATIONS_PER_THREAD.times do + require '__load_path_bench_script__' + $".pop + end + end + }.each(&:join) + system 'rm __load_path_bench_script__.rb' + p :ok + INPUT + end end -- cgit v1.2.3