From c5632105323a2ed48cb319de74d7e938e62b0a21 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 4 Apr 2018 05:00:52 +0000 Subject: use Queue for inter-thread synchronization. * test/ruby/test_bignum.rb (test_interrupt_during_to_s): should not use "while" synchronization, but should use Queue. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_bignum.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/ruby/test_bignum.rb') diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index 65d974005e..58d63a7c29 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -615,14 +615,15 @@ class TestBignum < Test::Unit::TestCase start_flag = false end_flag = false num = (65536 ** 65536) + q = Queue.new thread = Thread.new do - start_flag = true assert_raise(RuntimeError) { + q << true num.to_s end_flag = true } end - sleep 0.001 until start_flag + q.pop # sync thread.raise thread.join time = Time.now - time -- cgit v1.2.3