mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
signal.c: get rid of deadlock by discarded signals
* signal.c (rb_f_kill): get rid of deadlock as unhandled and discarded signals do not make interrupt_cond signaled. based on the patch by Kazuki Tsujimoto at [ruby-dev:48606]. [Bug #9820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1bb2721e4b
commit
2ebafed88a
3 changed files with 14 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
Tue Oct 7 23:40:16 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* signal.c (rb_f_kill): get rid of deadlock as unhandled and
|
||||
discarded signals do not make interrupt_cond signaled.
|
||||
based on the patch by Kazuki Tsujimoto at [ruby-dev:48606].
|
||||
[Bug #9820]
|
||||
|
||||
Tue Oct 7 22:43:44 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||
|
||||
* ext/win32ole/win32ole_method.c: use typed data.
|
||||
|
|
3
signal.c
3
signal.c
|
@ -487,7 +487,8 @@ rb_f_kill(int argc, const VALUE *argv)
|
|||
default:
|
||||
t = signal_ignored(sig);
|
||||
if (t) {
|
||||
if (t < 0) ruby_kill(pid, sig);
|
||||
if (t < 0 && kill(pid, sig))
|
||||
rb_sys_fail(0);
|
||||
break;
|
||||
}
|
||||
signal_enque(sig);
|
||||
|
|
|
@ -286,5 +286,10 @@ EOS
|
|||
assert_predicate(status, :signaled?, bug9820)
|
||||
assert_equal(trap, status.termsig, bug9820)
|
||||
end
|
||||
|
||||
if Signal.list['CONT']
|
||||
bug9820 = '[ruby-dev:48606] [Bug #9820]'
|
||||
assert_ruby_status(['-e', 'Process.kill(:CONT, $$)'])
|
||||
end
|
||||
end if Process.respond_to?(:kill)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue