diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-04 05:00:52 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-04 05:00:52 +0000 |
commit | c5632105323a2ed48cb319de74d7e938e62b0a21 (patch) | |
tree | 3a36a91aa67a877d5fda74adeafa79f44bd4017d /test/ruby/test_bignum.rb | |
parent | 5ff72d05693bbb2aba9094144b6ee8d8da77f1ca (diff) |
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
Diffstat (limited to 'test/ruby/test_bignum.rb')
-rw-r--r-- | test/ruby/test_bignum.rb | 5 |
1 files changed, 3 insertions, 2 deletions
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 |