aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-08-06 14:50:02 -0500
committerJoshua Peek <josh@joshpeek.com>2008-08-06 14:54:18 -0500
commite5b1ab7cc39ff57f9789ffda75fb33f72187775d (patch)
treedd161b502ccfaca2e408779107d37386aa368103 /activesupport/lib/active_support/cache.rb
parent73056500f88d569fa497d846dfe6b501a9e03739 (diff)
downloadrails-e5b1ab7cc39ff57f9789ffda75fb33f72187775d.tar.gz
rails-e5b1ab7cc39ff57f9789ffda75fb33f72187775d.tar.bz2
rails-e5b1ab7cc39ff57f9789ffda75fb33f72187775d.zip
MemoryStore is the only "unsafe" store. Make it threadsafe by default.
Diffstat (limited to 'activesupport/lib/active_support/cache.rb')
-rw-r--r--activesupport/lib/active_support/cache.rb18
1 files changed, 0 insertions, 18 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb
index 5a064f8bea..95eae3a77e 100644
--- a/activesupport/lib/active_support/cache.rb
+++ b/activesupport/lib/active_support/cache.rb
@@ -39,10 +39,6 @@ module ActiveSupport
class Store
cattr_accessor :logger
- def threadsafe!
- extend ThreadSafety
- end
-
def silence!
@silence = true
self
@@ -115,20 +111,6 @@ module ActiveSupport
logger.debug("Cache #{operation}: #{key}#{options ? " (#{options.inspect})" : ""}") if logger && !@silence && !@logger_off
end
end
-
- module ThreadSafety #:nodoc:
- def self.extended(object) #:nodoc:
- object.instance_variable_set(:@mutex, Mutex.new)
- end
-
- %w(read write delete delete_matched exist? increment decrement).each do |method|
- module_eval <<-EOS, __FILE__, __LINE__
- def #{method}(*args)
- @mutex.synchronize { super }
- end
- EOS
- end
- end
end
end