1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_exception.rb: fix thread issues.

* use Queue instead of a local variable for synchronization.
  * join created thread to soleve leaking threads warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2016-09-13 09:39:08 +00:00
parent 8a64787632
commit d4faa1013e
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,9 @@
Tue Sep 13 18:37:08 2016 Koichi Sasada <ko1@atdot.net>
* test/ruby/test_exception.rb: fix thread issues.
* use Queue instead of a local variable for synchronization.
* join created thread to soleve leaking threads warning.
Tue Sep 13 16:07:26 2016 Kazuki Yamaguchi <k@rhe.jp> Tue Sep 13 16:07:26 2016 Kazuki Yamaguchi <k@rhe.jp>
* string.c (rb_str_set_len): The buffer overflow check is wrong. The * string.c (rb_str_set_len): The buffer overflow check is wrong. The

View file

@ -723,9 +723,9 @@ end.join
bug12741 = '[ruby-core:77222] [Bug #12741]' bug12741 = '[ruby-core:77222] [Bug #12741]'
x = Thread.current x = Thread.current
a = false q = Queue.new
y = Thread.start do y = Thread.start do
Thread.pass until a q.pop
begin begin
raise "caller's cause" raise "caller's cause"
rescue rescue
@ -737,9 +737,11 @@ end.join
raise bug12741 raise bug12741
rescue rescue
e = assert_raise_with_message(RuntimeError, "stop") do e = assert_raise_with_message(RuntimeError, "stop") do
a = true q.push(true)
sleep 1 sleep 1
end end
ensure
y.join
end end
assert_equal("caller's cause", e.cause.message) assert_equal("caller's cause", e.cause.message)
end end