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

ruby-changes:32442

From: nobu <ko1@a...>
Date: Tue, 7 Jan 2014 21:21:58 +0900 (JST)
Subject: [ruby-changes:32442] nobu:r44521 (trunk): timeout.rb: revert r44520

nobu	2014-01-07 21:21:51 +0900 (Tue, 07 Jan 2014)

  New Revision: 44521

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

  Log:
    timeout.rb: revert r44520

  Modified files:
    trunk/lib/timeout.rb
Index: lib/timeout.rb
===================================================================
--- lib/timeout.rb	(revision 44520)
+++ lib/timeout.rb	(revision 44521)
@@ -26,21 +26,17 @@ module Timeout https://github.com/ruby/ruby/blob/trunk/lib/timeout.rb#L26
   class Error < RuntimeError
   end
   class ExitException < ::Exception # :nodoc:
-    attr_reader :target
-
-    def self.current_target
-      Thread.current
-    end
+    attr_reader :thread
 
     def self.catch
       exc = new
-      exc.instance_variable_set(:@target, current_target)
+      exc.instance_variable_set(:@thread, Thread.current)
       exc.freeze
       ::Kernel.catch(exc) {yield exc}
     end
 
     def exception(*)
-      throw(self, caller) if self.target == self.class.current_target
+      throw(self, caller) if self.thread == Thread.current
       self
     end
   end

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

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