Class: Concurrent::Synchronization::Condition
- Inherits:
-
LockableObject
- Object
- LockableObject
- Concurrent::Synchronization::Condition
- Defined in:
- lib/concurrent/synchronization/condition.rb
Instance Method Summary collapse
- #broadcast ⇒ Object
-
#initialize(lock) ⇒ Condition
constructor
A new instance of Condition.
- #ns_broadcast ⇒ Object
- #ns_signal ⇒ Object
- #ns_wait(timeout = nil) ⇒ Object
- #ns_wait_until(timeout = nil, &condition) ⇒ Object
- #signal ⇒ Object
- #wait(timeout = nil) ⇒ Object
- #wait_until(timeout = nil, &condition) ⇒ Object
Constructor Details
#initialize(lock) ⇒ Condition
Returns a new instance of Condition.
11 12 13 14 |
# File 'lib/concurrent/synchronization/condition.rb', line 11 def initialize(lock) super() @Lock = lock end |
Instance Method Details
#broadcast ⇒ Object
40 41 42 |
# File 'lib/concurrent/synchronization/condition.rb', line 40 def broadcast @Lock.synchronize { ns_broadcast } end |
#ns_broadcast ⇒ Object
44 45 46 |
# File 'lib/concurrent/synchronization/condition.rb', line 44 def ns_broadcast synchronize { super } end |
#ns_signal ⇒ Object
36 37 38 |
# File 'lib/concurrent/synchronization/condition.rb', line 36 def ns_signal synchronize { super } end |
#ns_wait(timeout = nil) ⇒ Object
20 21 22 |
# File 'lib/concurrent/synchronization/condition.rb', line 20 def ns_wait(timeout = nil) synchronize { super(timeout) } end |
#ns_wait_until(timeout = nil, &condition) ⇒ Object
28 29 30 |
# File 'lib/concurrent/synchronization/condition.rb', line 28 def ns_wait_until(timeout = nil, &condition) synchronize { super(timeout, &condition) } end |
#signal ⇒ Object
32 33 34 |
# File 'lib/concurrent/synchronization/condition.rb', line 32 def signal @Lock.synchronize { ns_signal } end |
#wait(timeout = nil) ⇒ Object
16 17 18 |
# File 'lib/concurrent/synchronization/condition.rb', line 16 def wait(timeout = nil) @Lock.synchronize { ns_wait(timeout) } end |
#wait_until(timeout = nil, &condition) ⇒ Object
24 25 26 |
# File 'lib/concurrent/synchronization/condition.rb', line 24 def wait_until(timeout = nil, &condition) @Lock.synchronize { ns_wait_until(timeout, &condition) } end |