summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-14 02:26:20 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-14 02:26:20 +0000
commit23f9e7460462efa9273c05b8c616ca9dfa6e24af (patch)
treee99d2c6ac551cb9a4942d7f059b09a08a85c30a2 /test
parent24c376662401a2d9886d63423ddfb72d697747fb (diff)
* thread_pthread.c (ubf_select): call rb_thread_wakeup_timer_thread()
only when it is not timer_thread. [Bug #5757] [ruby-dev:44985] patched by Tomoyuki Chikanaga. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_thread.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 0809533f14..a11cd196f6 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -686,4 +686,19 @@ class TestThreadGroup < Test::Unit::TestCase
t.join
assert_equal(nil, t.backtrace)
end
+
+ def test_thread_timer_and_interrupt
+ bug5757 = '[ruby-dev:44985]'
+ t0 = Time.now.to_f
+ pid = spawn(EnvUtil.rubybin, '-e', '$stdin.read')
+ sleep 1;
+ Process.kill(:SIGQUIT, pid)
+ Process.wait(pid)
+ s = $?
+ assert_equal([false, true, false],
+ [s.exited?, s.signaled?, s.stopped?],
+ "[s.exited?, s.signaled?, s.stopped?]")
+ t1 = Time.now.to_f
+ assert_in_delta(t1 - t0, 1, 1)
+ end
end