Class: Libhoney::Queueing::QCondition
- Inherits:
-
Object
- Object
- Libhoney::Queueing::QCondition
- Defined in:
- lib/libhoney/queueing/sized_queue_with_timeout.rb
Instance Method Summary collapse
-
#initialize(lock) ⇒ QCondition
constructor
A new instance of QCondition.
- #signal ⇒ Object
- #wait(timeout = nil) ⇒ Object
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
#signal ⇒ Object
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 |