Sha256: 9e0ac8d51d47e0e3a3fa564462fd861f9fba6e1be8e6b472d61b31ca18fc8b01

Contents?: true

Size: 292 Bytes

Versions: 10

Compression:

Stored size: 292 Bytes

Contents

# Thread safe hash
class CleanHash
  class MutexHash < Indifferent
    MUTEX = Mutex.new

    def []= name, value
      MUTEX.synchronize do
        @data[name] =
        if value.is_a?(Hash)
          self.class.new value
        else
          value
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
clean-hash-0.5.11 ./lib/clean-hash/types/mutex_type.rb
clean-hash-0.5.10 ./lib/clean-hash/types/mutex_type.rb
clean-hash-0.5.9 ./lib/clean-hash/types/mutex_type.rb
clean-hash-0.5.8 ./lib/clean-hash/types/mutex_type.rb
clean-hash-0.5.6 ./lib/clean-hash/types/mutex_type.rb
clean-hash-0.5.5 ./lib/clean-hash/types/mutex_type.rb
clean-hash-0.5.4 ./lib/clean-hash/types/mutex_type.rb
clean-hash-0.5.3 ./lib/clean-hash/types/mutex_type.rb
clean-hash-0.5.2 ./lib/clean-hash/types/mutex_type.rb
clean-hash-0.5.1 ./lib/clean-hash/types/mutex_type.rb