Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Treat single C operations in MemoryStore as atomic

  • Loading branch information...
commit fbc6129acd9ecb6b7435931b472d3226985ba4c4 1 parent dfc8356
@josh josh authored
Showing with 8 additions and 23 deletions.
  1. +8 −23 activesupport/lib/active_support/cache/memory_store.rb
View
31 activesupport/lib/active_support/cache/memory_store.rb
@@ -13,38 +13,25 @@ def fetch(key, options = {})
end
def read(name, options = nil)
- @mutex.synchronize do
- super
- @data[name]
- end
+ super
+ @data[name]
end
def write(name, value, options = nil)
- @mutex.synchronize do
- super
- @data[name] = value
- end
+ super
+ @data[name] = value
end
def delete(name, options = nil)
- @mutex.synchronize do
- super
- @data.delete(name)
- end
+ @data.delete(name)
end
def delete_matched(matcher, options = nil)
- @mutex.synchronize do
- super
- @data.delete_if { |k,v| k =~ matcher }
- end
+ @data.delete_if { |k,v| k =~ matcher }
end
def exist?(name,options = nil)
- @mutex.synchronize do
- super
- @data.has_key?(name)
- end
+ @data.has_key?(name)
end
def increment(key, amount = 1)
@@ -60,9 +47,7 @@ def decrement(key, amount = 1)
end
def clear
- @mutex.synchronize do
- @data.clear
- end
+ @data.clear
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.