Sha256: 72eca0da64e167191ff0c93487df9ea7c9f700bcf52b144bce2ef06f4de9f514

Contents?: true

Size: 1.08 KB

Versions: 118

Compression:

Stored size: 1.08 KB

Contents

if Concurrent.on_jruby?

  module Concurrent

    # @!macro count_down_latch
    # @!visibility private
    # @!macro internal_implementation_note
    class JavaCountDownLatch

      # @!macro count_down_latch_method_initialize
      def initialize(count = 1)
        Utility::NativeInteger.ensure_integer_and_bounds(count)
        Utility::NativeInteger.ensure_positive(count)
        @latch = java.util.concurrent.CountDownLatch.new(count)
      end

      # @!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

      # @!macro count_down_latch_method_count_down
      def count_down
        @latch.countDown
      end

      # @!macro count_down_latch_method_count
      def count
        @latch.getCount
      end
    end
  end
end

Version data entries

118 entries across 104 versions & 25 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
o-concurrent-ruby-1.1.13 lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
o-concurrent-ruby-1.1.12 lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
o-concurrent-ruby-1.1.11 lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
concurrent-ruby-1.1.10 lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent/atomic/java_count_down_latch.rb