diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-17 08:26:17 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-17 08:26:17 +0000 |
commit | db9523ef47c9bdc895803a12690713bf49379051 (patch) | |
tree | 1829cf9577832ae78e2f4c34e23ce3fe6ba3cb11 /test/ruby/test_thread.rb | |
parent | 78cc1491d5dd106af94edd91b3ca4698423daaf7 (diff) | |
download | ruby-db9523ef47c9bdc895803a12690713bf49379051.tar.gz |
thread.c: fix overly long Thread#join w/ timeout
* test/ruby/test_thread.rb (test_signal_at_join): test with timeout
* thread.c (sleep_wait_for_interrupt): remove
(thread_join_sleep): use native_sleep directly to avoid extra
missing thread status change
[Bug #14181]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_thread.rb')
-rw-r--r-- | test/ruby/test_thread.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 5f64a08155..3695f6e4ea 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -1284,6 +1284,20 @@ q.pop end end end + n.times do + w = Thread.start { sleep 30 } + begin + f.puts + f.gets + ensure + w.kill + t0 = Process.clock_gettime(Process::CLOCK_MONOTONIC) + w.join(30) + t1 = Process.clock_gettime(Process::CLOCK_MONOTONIC) + diff = t1 - t0 + assert_operator diff, :<=, 2 + end + end end }; end |