Type:
Class
Constants:
TimeoutMutex : Mutex.new # :nodoc:

Mutex used to synchronize access across threads

Class used to manage timeout handlers across multiple threads.

Timeout handlers should be managed by using the class methods which are synchronized.

id = TimeoutHandler.register(10, Timeout::Error)
begin
  sleep 20
  puts 'foo'
ensure
  TimeoutHandler.cancel(id)
end

will raise Timeout::Error

id = TimeoutHandler.register(10, Timeout::Error)
begin
  sleep 5
  puts 'foo'
ensure
  TimeoutHandler.cancel(id)
end

will print 'foo'

register 2

register(thread, time, exception) Instance Public methods Registers a new timeout

2015-06-12 07:47:43
register

register(seconds, exception) Class Public methods Registers a new timeout handler

2015-06-12 07:35:05
new

new() Class Public methods Creates a new

2015-06-12 07:32:12
cancel 2

cancel(thread, id) Instance Public methods Cancels the timeout handler id

2015-06-12 07:40:20
interrupt

interrupt(thread, id, exception) Instance Public methods Interrupts the timeout

2015-06-12 07:45:22
cancel

cancel(id) Class Public methods Cancels the timeout handler id

2015-06-12 07:25:24