Extended maintenance of Ruby versions 1.8.7 and 1.9.2 ended on July 31, 2014. Read more
# File webrick/utils.rb, line 115 def TimeoutHandler.cancel(id) TimeoutMutex.synchronize{ instance.cancel(Thread.current, id) } end
# File webrick/utils.rb, line 121 def initialize @timeout_info = Hash.new Thread.start{ while true now = Time.now @timeout_info.each{|thread, ary| ary.dup.each{|info| time, exception = *info interrupt(thread, info.object_id, exception) if time < now } } sleep 0.5 end } end
# File webrick/utils.rb, line 151 def cancel(thread, id) if ary = @timeout_info[thread] ary.delete_if{|info| info.object_id == id } if ary.empty? @timeout_info.delete(thread) end return true end return false end