Class: DatawireQuarkCore::Condition
- Defined in:
- lib/datawire-quark-core.rb
Instance Method Summary collapse
-
#initialize ⇒ Condition
constructor
A new instance of Condition.
- #waitWakeup(timeout) ⇒ Object
- #wakeup ⇒ Object
Methods inherited from Lock
Constructor Details
#initialize ⇒ Condition
Returns a new instance of Condition.
1068 1069 1070 1071 |
# File 'lib/datawire-quark-core.rb', line 1068 def initialize super @condition = ::Thread::ConditionVariable.new end |
Instance Method Details
#waitWakeup(timeout) ⇒ Object
1072 1073 1074 1075 1076 1077 |
# File 'lib/datawire-quark-core.rb', line 1072 def waitWakeup(timeout) if !@lock.owned? fail "Illegal waitWakeup of a not-acquired quark Condition" end @condition.wait(@lock, timeout / 1000.0) end |
#wakeup ⇒ Object
1079 1080 1081 1082 1083 1084 |
# File 'lib/datawire-quark-core.rb', line 1079 def wakeup if !@lock.owned? fail "Illegal wakeup of a not-acquired quark Condition" end @condition.signal end |