Class: Libhoney::Queueing::QCondition

Inherits:
Object
  • Object
show all
Defined in:
lib/libhoney/queueing/sized_queue_with_timeout.rb

Instance Method Summary collapse

Constructor Details

#initialize(lock) ⇒ QCondition

Returns a new instance of QCondition.



150
151
152
153
# File 'lib/libhoney/queueing/sized_queue_with_timeout.rb', line 150

def initialize(lock)
  @lock = lock
  @cv   = ConditionVariable.new
end

Instance Method Details

#signalObject



159
160
161
# File 'lib/libhoney/queueing/sized_queue_with_timeout.rb', line 159

def signal
  @cv.signal
end

#wait(timeout = nil) ⇒ Object



155
156
157
# File 'lib/libhoney/queueing/sized_queue_with_timeout.rb', line 155

def wait(timeout = nil)
  @cv.wait(@lock.mutex, timeout)
end