1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (ruby_cleanup): before cleanup, check signal buffer and run

handler if any.  [ruby-core:20970]

* thread.c (rb_threadptr_check_signal): separeted from
  timer_thread_function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2010-04-27 12:27:13 +00:00
parent 6fd326e76c
commit 4af243a8af
4 changed files with 45 additions and 10 deletions

View file

@ -36,7 +36,7 @@ class TestSignal < Test::Unit::TestCase
end
def test_exit_action
return unless have_fork? # snip this test
return unless have_fork? # skip this test
begin
r, w = IO.pipe
r0, w0 = IO.pipe
@ -166,4 +166,17 @@ class TestSignal < Test::Unit::TestCase
Signal.trap(:INT, oldtrap) if oldtrap
end
end
def test_kill_immediately_before_termination
return unless have_fork? # skip this test
r, w = IO.pipe
pid = Process.fork do
r.close
Signal.trap(:USR1) { w.syswrite("foo") }
Process.kill :USR1, $$
end
w.close
assert_equal(r.read, "foo")
end
end