summaryrefslogtreecommitdiff
path: root/lib/timeout.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-07 12:21:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-07 12:21:51 +0000
commit1fa01c12df09fa82430bd36c29219a919f83b2d9 (patch)
tree8dde0691c728e9d70a10117a689f79522647715b /lib/timeout.rb
parent82b1790df0107755a10f7d0bed2d9df33e2ac4e2 (diff)
timeout.rb: revert r44520
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/timeout.rb')
-rw-r--r--lib/timeout.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/timeout.rb b/lib/timeout.rb
index 672b2d719c..441f8d4236 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -26,21 +26,17 @@ module Timeout
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