class Concurrent::JavaCountDownLatch

def wait(timeout = nil)

@!macro count_down_latch_method_wait
def wait(timeout = nil)
  result = nil
  if timeout.nil?
    Synchronization::JRuby.sleep_interruptibly { @latch.await }
    result = true
  else
    Synchronization::JRuby.sleep_interruptibly do
      result = @latch.await(1000 * timeout, java.util.concurrent.TimeUnit::MILLISECONDS)
    end
  end
  result
end