[前][次][番号順一覧][スレッド一覧]

ruby-changes:26164

From: tarui <ko1@a...>
Date: Thu, 6 Dec 2012 00:53:37 +0900 (JST)
Subject: [ruby-changes:26164] tarui:r38221 (trunk): * lib/timeout.rb (Timeout#timeout): specify a exception

tarui	2012-12-06 00:53:27 +0900 (Thu, 06 Dec 2012)

  New Revision: 38221

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38221

  Log:
    * lib/timeout.rb (Timeout#timeout): specify a exception
      more strictly at async_interrupt_timing.

  Modified files:
    trunk/ChangeLog
    trunk/lib/timeout.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38220)
+++ ChangeLog	(revision 38221)
@@ -1,3 +1,8 @@
+Thu Dec  6 00:51:21 2012  Masaya Tarui  <tarui@r...>
+
+	* lib/timeout.rb (Timeout#timeout): specify a exception
+	  more strictly at async_interrupt_timing.
+
 Wed Dec  5 04:50:17 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* lib/timeout.rb (Timeout#timeout): set
Index: lib/timeout.rb
===================================================================
--- lib/timeout.rb	(revision 38220)
+++ lib/timeout.rb	(revision 38221)
@@ -49,8 +49,8 @@
   # a module method, so you can call it directly as Timeout.timeout().
   def timeout(sec, klass = nil, immediate: false)   #:yield: +sec+
     return yield(sec) if sec == nil or sec.zero?
-    Thread.async_interrupt_timing(klass ? klass : ExitException => immediate ? :immediate : :on_blocking) do
-      exception = klass || Class.new(ExitException)
+    exception = klass || Class.new(ExitException)
+    Thread.async_interrupt_timing(exception => immediate ? :immediate : :on_blocking) do
       begin
         begin
           x = Thread.current

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]