From 5041f548ddc88f8a48d8f4e099dc2c5790a17d00 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 28 Jun 2017 15:25:30 +0000 Subject: introduce rb_fiber_t::first_proc. * cont.c (rb_fiber_t): add rb_fiber_t::first_proc and do not use rb_thread_t::first_proc which should be thread local. [Bug #13689] * test/ruby/test_thread.rb: test for [Bug #13689]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_thread.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ruby/test_thread.rb') diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 529c52f4ba..dbe4ac21b9 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -34,6 +34,19 @@ class TestThread < Test::Unit::TestCase th.join end + def test_inspect_with_fiber + inspect1 = inspect2 = nil + + Thread.new{ + inspect1 = Thread.current.inspect + Fiber.new{ + inspect2 = Thread.current.inspect + }.resume + }.join + + assert_equal inspect1, inspect2, '[Bug #13689]' + end + def test_main_thread_variable_in_enumerator assert_equal Thread.main, Thread.current -- cgit v1.2.3