Class: ConditionVariable

Inherits:
Object
  • Object
show all
Defined in:
lib/god/compat19.rb

Overview

Instance Method Summary collapse

Instance Method Details

#wait(mutex, timeout = nil) ⇒ Object


23
24
25
26
27
28
29
30
31
32
# File 'lib/god/compat19.rb', line 23

def wait(mutex, timeout=nil)
  begin
    # TODO: mutex should not be used
    @waiters_mutex.synchronize do
      @waiters.push(Thread.current)
    end
    mutex.sleep timeout
  end
  self
end