# File lib/rubyrep/task_sweeper.rb, line 58 def timeout exception = nil self.thread = Thread.new do begin yield rescue Exception => e # save exception so it can be rethrown outside of the thread exception = e end end while self.thread.join(self.timeout_period) == nil do if self.last_ping < Time.now - self.timeout_period self.terminated = true break end end