mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
thread.c: refine stream closed message
* thread.c (Init_Thread): [EXPERIMENTAL] refine the "stream closed" special exception message, by explicating that it is caused by threading. [ruby-core:80583] [Bug #13405] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dce00119c6
commit
f9ca643683
4 changed files with 8 additions and 3 deletions
4
NEWS
4
NEWS
|
@ -34,6 +34,10 @@ with all sufficient information, see the ChangeLog file or Redmine
|
||||||
* IO#pread [Feature #4532]
|
* IO#pread [Feature #4532]
|
||||||
* IO#pwrite [Feature #4532]
|
* IO#pwrite [Feature #4532]
|
||||||
|
|
||||||
|
* IOError
|
||||||
|
|
||||||
|
* exception message "stream closed" is changed [Bug #13405]
|
||||||
|
|
||||||
* Regexp
|
* Regexp
|
||||||
* Update Onigmo 6.1.1.
|
* Update Onigmo 6.1.1.
|
||||||
* Support absent operator https://github.com/k-takata/Onigmo/issues/82
|
* Support absent operator https://github.com/k-takata/Onigmo/issues/82
|
||||||
|
|
|
@ -225,7 +225,7 @@ module Test
|
||||||
rescue Errno::EPIPE
|
rescue Errno::EPIPE
|
||||||
died
|
died
|
||||||
rescue IOError
|
rescue IOError
|
||||||
raise unless ["stream closed","closed stream"].include? $!.message
|
raise unless /stream closed|closed stream/ =~ $!.message
|
||||||
died
|
died
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -61,7 +61,7 @@ module Test
|
||||||
begin
|
begin
|
||||||
th.join
|
th.join
|
||||||
rescue IOError
|
rescue IOError
|
||||||
raise unless ["stream closed","closed stream"].include? $!.message
|
raise unless /stream closed|closed stream/ =~ $!.message
|
||||||
end
|
end
|
||||||
i.close
|
i.close
|
||||||
|
|
||||||
|
|
3
thread.c
3
thread.c
|
@ -4881,7 +4881,8 @@ Init_Thread(void)
|
||||||
rb_define_method(rb_cThread, "name=", rb_thread_setname, 1);
|
rb_define_method(rb_cThread, "name=", rb_thread_setname, 1);
|
||||||
rb_define_method(rb_cThread, "inspect", rb_thread_inspect, 0);
|
rb_define_method(rb_cThread, "inspect", rb_thread_inspect, 0);
|
||||||
|
|
||||||
rb_vm_register_special_exception(ruby_error_stream_closed, rb_eIOError, "stream closed");
|
rb_vm_register_special_exception(ruby_error_stream_closed, rb_eIOError,
|
||||||
|
"stream closed in another thread");
|
||||||
|
|
||||||
cThGroup = rb_define_class("ThreadGroup", rb_cObject);
|
cThGroup = rb_define_class("ThreadGroup", rb_cObject);
|
||||||
rb_define_alloc_func(cThGroup, thgroup_s_alloc);
|
rb_define_alloc_func(cThGroup, thgroup_s_alloc);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue