~ubuntu-branches/ubuntu/intrepid/ruby1.9/intrepid-updates

« back to all changes in this revision

Viewing changes to lib/webrick/utils.rb

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-05-21 14:00:19 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070521140019-ui4zd0v80duktssk
Tags: 1.9.0+20070521-1
new upstream snapshot. (2006-07-21)  (Closes: #414856, #388344)

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
          while true
125
125
            now = Time.now
126
126
            @timeout_info.each{|thread, ary|
127
 
              ary.each{|info|
 
127
              ary.dup.each{|info|
128
128
                time, exception = *info
129
129
                interrupt(thread, info.object_id, exception) if time < now
130
130
              }
162
162
 
163
163
    def timeout(seconds, exception=Timeout::Error)
164
164
      return yield if seconds.nil? or seconds.zero?
165
 
      raise ThreadError, "timeout within critical session" if Thread.critical
 
165
      # raise ThreadError, "timeout within critical session" if Thread.critical
166
166
      id = TimeoutHandler.register(seconds, exception)
167
167
      begin
168
168
        yield(seconds)