Sha256: c8051567764ee5cb1447866995aeb7398335e19f575864df84642d2504bf3e29

Contents?: true

Size: 1.05 KB

Versions: 54

Compression:

Stored size: 1.05 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? || Concurrent.on_truffle?
    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

54 entries across 50 versions & 13 rubygems

Version Path
tdiary-5.0.11 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
sprokovuln-0.2.0 vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/array.rb
tdiary-5.0.9 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
monero_wallet_gen-0.1.0 vendor/bundle/ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
tdiary-5.0.8 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
tdiary-5.0.7 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
tdiary-5.0.6 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/array.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/array.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/array.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
tdiary-5.0.5 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
lazy_record-0.2.1 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
lazy_record-0.2.0 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb
lazy_record-0.1.9 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/array.rb