summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/thread/test_cv.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/thread/test_cv.rb b/test/thread/test_cv.rb
index 9f9e08e..49fee24 100644
--- a/test/thread/test_cv.rb
+++ b/test/thread/test_cv.rb
@@ -74,8 +74,10 @@ class TestConditionVariable < Test::Unit::TestCase
condvar.broadcast
result << "P2"
end
- nr_threads.times do |i|
- threads[i].join
+ Timeout.timeout(5) do
+ nr_threads.times do |i|
+ threads[i].join
+ end
end
assert_equal ["C1", "C1", "C1", "P1", "P2", "C2", "C2", "C2"], result