summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-15 13:30:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-15 13:30:03 +0000
commit4bf8fa83b7084040fbe12cc003f881ccf128c911 (patch)
treeaec6953af49ffc9c3bf3c405e6d67a71cb73b97c /test/ruby
parentffd0301a35d0829e21f2510265355896497e1a9c (diff)
thread.c: defer setting name in initialize
* thread.c (rb_thread_setname): defer setting native thread name set in initialize until the native thread is created. [ruby-core:74963] [Bug #12290] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_thread.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 05bb536111..f13a962c9b 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -1099,9 +1099,9 @@ q.pop
t.join
end
- def test_thread_setname_uninitialized
+ def test_thread_setname_in_initialize
bug12290 = '[ruby-core:74963] [Bug #12290]'
- c = Class.new(Thread) {def initialize() self.name = "foo" end}
- assert_raise(ThreadError, bug12290) {c.new {}}
+ c = Class.new(Thread) {def initialize() self.name = "foo"; super; end}
+ assert_equal("foo", c.new {Thread.current.name}.value)
end
end