From bc1a18d7bd8898fea6d41d59f4016b4be51e371b Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Wed, 14 Oct 2009 19:53:52 -0500 Subject: Punt on ConcurrentHash [#3322 state:resolved] --- activesupport/lib/active_support/autoload.rb | 1 - .../lib/active_support/concurrent_hash.rb | 27 ---------------------- 2 files changed, 28 deletions(-) delete mode 100644 activesupport/lib/active_support/concurrent_hash.rb (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/autoload.rb b/activesupport/lib/active_support/autoload.rb index 2b5ebcf390..da12ecceca 100644 --- a/activesupport/lib/active_support/autoload.rb +++ b/activesupport/lib/active_support/autoload.rb @@ -6,7 +6,6 @@ module ActiveSupport autoload :Cache, 'active_support/cache' autoload :Callbacks, 'active_support/callbacks' autoload :Concern, 'active_support/concern' - autoload :ConcurrentHash, 'active_support/concurrent_hash' autoload :Configurable, 'active_support/configurable' autoload :DependencyModule, 'active_support/dependency_module' autoload :DeprecatedCallbacks, 'active_support/deprecated_callbacks' diff --git a/activesupport/lib/active_support/concurrent_hash.rb b/activesupport/lib/active_support/concurrent_hash.rb deleted file mode 100644 index 40224765a7..0000000000 --- a/activesupport/lib/active_support/concurrent_hash.rb +++ /dev/null @@ -1,27 +0,0 @@ -module ActiveSupport - class ConcurrentHash - def initialize(hash = {}) - @backup_cache = hash.dup - @frozen_cache = hash.dup.freeze - @mutex = Mutex.new - end - - def []=(k,v) - @mutex.synchronize { @backup_cache[k] = v } - @frozen_cache = @backup_cache.dup.freeze - v - end - - def [](k) - if @frozen_cache.key?(k) - @frozen_cache[k] - else - @mutex.synchronize { @backup_cache[k] } - end - end - - def empty? - @backup_cache.empty? - end - end -end -- cgit v1.2.3