diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-13 08:39:30 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-13 08:39:30 +0000 |
commit | 712a570f5624c0beaac808e03c26915c7afd0806 (patch) | |
tree | cea0a90fc907b3ee1aaec51efcd29e71e159bd2a /test/ruby | |
parent | 654b90d31a59f16a3c03b7def85acac84d722034 (diff) | |
download | ruby-712a570f5624c0beaac808e03c26915c7afd0806.tar.gz |
* vm_core.h (rb_thread_t): add th->name.
* vm.c (th_init): initialize th->name.
* thread.c (Init_Thread): add Thread.name and Thread.name=.
* thread.c (rb_thread_inspect): show thread's name if set.
* thread.c (rb_thread_getname): defined.
* thread.c (rb_thread_setname): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_thread.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index ade680c55b..3f4a8c8ea0 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -1046,4 +1046,11 @@ q.pop t.new {} end end + + def test_thread_name + t = Thread.start { } + t.name = 'foo' + assert_equal 'foo', t.name + t.join + end end |