Class: Redstream::Lock::Signal Private

Inherits:
Object
  • Object
show all
Defined in:
lib/redstream/lock.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initializeSignal

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Signal.



25
26
27
28
# File 'lib/redstream/lock.rb', line 25

def initialize
  @mutex = Mutex.new
  @condition_variable = ConditionVariable.new
end

Instance Method Details

#signalObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



34
35
36
# File 'lib/redstream/lock.rb', line 34

def signal
  @condition_variable.signal
end

#wait(timeout) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



30
31
32
# File 'lib/redstream/lock.rb', line 30

def wait(timeout)
  @mutex.synchronize { @condition_variable.wait(@mutex, timeout) }
end