aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-13 09:39:08 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-13 09:39:08 +0000
commita5674b00bdef0c3442745d0b554f09a532f9a71a (patch)
treead0e001d365b6a1acfa1685eac32a859c319072a
parent9be80649453d30dd9c010af2ee1132753b4417dc (diff)
downloadruby-a5674b00bdef0c3442745d0b554f09a532f9a71a.tar.gz
* 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
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_exception.rb8
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 920a11c..56c7c99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* string.c (rb_str_set_len): The buffer overflow check is wrong. The
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 03c0c81..10489dd 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -723,9 +723,9 @@ end.join
bug12741 = '[ruby-core:77222] [Bug #12741]'
x = Thread.current
- a = false
+ q = Queue.new
y = Thread.start do
- Thread.pass until a
+ q.pop
begin
raise "caller's cause"
rescue
@@ -737,9 +737,11 @@ end.join
raise bug12741
rescue
e = assert_raise_with_message(RuntimeError, "stop") do
- a = true
+ q.push(true)
sleep 1
end
+ ensure
+ y.join
end
assert_equal("caller's cause", e.cause.message)
end