Merge commit 'rails/3-0-unstable'

This commit is contained in:
Yehuda Katz
2009-02-02 09:54:27 -08:00
2 changed files with 0 additions and 26 deletions

View File

@@ -3,7 +3,6 @@ require 'stringio'
require 'strscan'
require 'active_support/memoizable'
require 'action_controller/cgi_ext'
module ActionDispatch
class Request < Rack::Request

View File

@@ -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|