summaryrefslogtreecommitdiff
path: root/lib/timeout.rb
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-06-04 19:19:37 -0700
committerJeremy Evans <code@jeremyevans.net>2019-06-04 19:19:37 -0700
commit96d65274246a4be88581693f452e6b3bae9fdc5c (patch)
tree0679012a76d5dbc140e778f31945c5920c94d1e9 /lib/timeout.rb
parenta105831819af8d143dd587a93844ca982cfadd67 (diff)
Add some documentation to Timeout#timeout about possible issues
Documentation requested in [Bug #15886].
Diffstat (limited to 'lib/timeout.rb')
-rw-r--r--lib/timeout.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/timeout.rb b/lib/timeout.rb
index a33bb4ce65..62a35169a4 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -67,7 +67,9 @@ module Timeout
# +sec+ seconds, otherwise throws an exception, based on the value of +klass+.
#
# The exception thrown to terminate the given block cannot be rescued inside
- # the block unless +klass+ is given explicitly.
+ # the block unless +klass+ is given explicitly. However, the block can use
+ # ensure to prevent the handling of the exception. For that reason, this
+ # method cannot be relied on to enforce timeouts for untrusted blocks.
#
# Note that this is both a method of module Timeout, so you can <tt>include
# Timeout</tt> into your classes so they have a #timeout method, as well as