Sha256: e7da66a15e2f7d382d71a937b51ac3720f457abc6598de206fa0e7e228a27dc5

Contents?: true

Size: 1.02 KB

Versions: 35

Compression:

Stored size: 1.02 KB

Contents

require 'concurrent/utility/engine'
require 'concurrent/thread_safe/util'

module Concurrent
  if Concurrent.on_cruby?

    # Because MRI never runs code in parallel, the existing
    # non-thread-safe structures should usually work fine.

    # @!macro [attach] concurrent_array
    #
    #   A thread-safe subclass of Array. This version locks against the object
    #   itself for every method call, ensuring only one thread can be reading
    #   or writing at a time. This includes iteration methods like `#each`.
    #
    #   @see http://ruby-doc.org/core-2.2.0/Array.html Ruby standard library `Array`
    class Array < ::Array;
    end

  elsif Concurrent.on_jruby?
    require 'jruby/synchronized'

    # @!macro concurrent_array
    class Array < ::Array
      include JRuby::Synchronized
    end

  elsif Concurrent.on_rbx?
    require 'monitor'
    require 'concurrent/thread_safe/util/array_hash_rbx'

    # @!macro concurrent_array
    class Array < ::Array
    end

    ThreadSafe::Util.make_synchronized_on_rbx Array
  end
end

Version data entries

35 entries across 33 versions & 12 rubygems

Version Path
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-filter-csharp-0.1.0 vendor/bundle/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-filter-htmlentities-0.1.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-output-icinga-1.0.0 vendor/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-input-fifo-0.9.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/array.rb