Skip to content
Browse files

Remove duplicate ConcurrentHash

  • Loading branch information...
1 parent 85750f2 commit 8da52b13b5a565d4c41c3e3b3f2562f3f1852a56 @jeremy jeremy committed Jan 31, 2009
Showing with 0 additions and 25 deletions.
  1. +0 −25 activesupport/lib/active_support/memoizable.rb
View
25 activesupport/lib/active_support/memoizable.rb
@@ -1,29 +1,4 @@
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
- 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
-
module SafelyMemoizable
def safely_memoize(*symbols)
symbols.each do |symbol|

0 comments on commit 8da52b1

Please sign in to comment.
Something went wrong with that request. Please try again.