mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
adjust style and fix typo and indent
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1b648d0467
commit
61f46bafa4
2 changed files with 4 additions and 3 deletions
|
@ -48,7 +48,7 @@ module Timeout
|
|||
# Timeout</tt> into your classes so they have a #timeout method, as well as
|
||||
# a module method, so you can call it directly as Timeout.timeout().
|
||||
def timeout(sec, klass = nil, immediate: false) #:yield: +sec+
|
||||
return yield(sec) if sec == nil or sec.zero?
|
||||
return yield(sec) if sec == nil or sec.zero?
|
||||
Thread.async_interrupt_timing(klass ? klass : ExitException => immediate ? :immediate : :on_blocking) do
|
||||
exception = klass || Class.new(ExitException)
|
||||
begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue