Forum: Ruby-dev cannot stop with Ctrl+C

Posted by kosaki (Motohiro KOSAKI) (Guest)
on 2012-11-27 03:04
(Received via mailing list)
Issue #1952 has been updated by kosaki (Motohiro KOSAKI).


ついでというわけではないんですが、mameさんのcomment#10のようなスクリプトへの防御力をあげるため、メインスレッドがサブスレッド終了を待ってる時はステータスをTHREAD_KILLEDに変える修正を 
r37886 で入れました。メインスレッドはすでに終了しているのだから、thr.raiseが動いてしまっているのがそもそもおかしかった。

----------------------------------------
Feature #1952: cannot stop with Ctrl+C
https://bugs.ruby-lang.org/issues/1952#change-33999

Author: usa (Usaku NAKAMURA)
Status: Closed
Priority: High
Assignee: ko1 (Koichi Sasada)
Category: core
Target version: 2.0.0


=begin
 以下のスクリプトがCtrl+Cで停止せず、Ctrl+C押下後はkill -9でしか殺せません。

 Thread.new do
   begin
     begin
       sleep
     ensure
       raise
     end
   rescue
     retry
   end
 end.join
=end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.