diff --git a/lib/timeout.rb b/lib/timeout.rb index 414983088c..4659ec3279 100644 --- a/lib/timeout.rb +++ b/lib/timeout.rb @@ -67,11 +67,13 @@ module Timeout @message = message @mutex = Mutex.new - @done = false + @done = false # protected by @mutex end def done? - @done + @mutex.synchronize do + @done + end end def expired?(now)