class Concurrent::MutexCountDownLatch
@!macro internal_implementation_note
@!visibility private
@!macro count_down_latch
def count
def count synchronize { @count } end
def count_down
def count_down synchronize do @count -= 1 if @count > 0 ns_broadcast if @count == 0 end end
def initialize(count = 1)
def initialize(count = 1) Utility::NativeInteger.ensure_integer_and_bounds count Utility::NativeInteger.ensure_positive count super() synchronize { ns_initialize count } end
def ns_initialize(count)
def ns_initialize(count) @count = count end
def wait(timeout = nil)
def wait(timeout = nil) synchronize { ns_wait_until(timeout) { @count == 0 } } end