Sha256: 796be83eb2fc75a2dbbdc7bbd03d57423fc42a2e5fc95e2e55fc11caeae57156

Contents?: true

Size: 999 Bytes

Versions: 43

Compression:

Stored size: 999 Bytes

Contents

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

module Concurrent
  if Concurrent.on_cruby?

    # @!macro [attach] concurrent_hash
    #
    #   A thread-safe subclass of Hash. 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`,
    #   which takes the lock repeatedly when reading an item.
    #
    #   @see http://ruby-doc.org/core-2.2.0/Hash.html Ruby standard library `Hash`
    class Hash < ::Hash;
    end

  elsif Concurrent.on_jruby?
    require 'jruby/synchronized'

    # @!macro concurrent_hash
    class Hash < ::Hash
      include JRuby::Synchronized
    end

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

    # @!macro concurrent_hash
    class Hash < ::Hash
    end

    ThreadSafe::Util.make_synchronized_on_rbx Hash
  end
end

Version data entries

43 entries across 40 versions & 11 rubygems

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