begin
Timeout::timeout(OverallTimeout) do |tl|
# Until I find out what this is, Forget it…
# No doc on tl anymore! #puts “tl: #{tl}”
probe_threads.each { |t| t.join }
puts “done”
end
rescue Timeout::Error => eo
puts “#{eo.message}, exiting before joining all probe threads.”
end
According to the document[1], tl is same to OverallTimeout.
BTW, I noticed the 1.8.6 document[2] is wrong in block parameter.
timeout(sec, exception=Error) {|if sec == nil or sec.zero?| …}
I guess it is related to the bug in the source code of 1.8.6 and 1.8.7
The first line of method timeout
return yield if sec == nil or sec.zero?
should be
return yield(sec) if sec == nil or sec.zero?