Class: Concurrent::Synchronization::Condition

Inherits:
LockableObject
  • Object
show all
Defined in:
lib/concurrent/synchronization/condition.rb

Instance Method Summary collapse

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

#broadcastObject



40
41
42
# File 'lib/concurrent/synchronization/condition.rb', line 40

def broadcast
  @Lock.synchronize { ns_broadcast }
end

#ns_broadcastObject



44
45
46
# File 'lib/concurrent/synchronization/condition.rb', line 44

def ns_broadcast
  synchronize { super }
end

#ns_signalObject



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

#signalObject



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