[1.0.X] Fixed #9626 -- Fixed a deletion race in the locmem cache.

Backport of r9998 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10001 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2009-03-08 10:02:23 +00:00
parent 055c01103d
commit b1fd7650a9
1 changed files with 5 additions and 2 deletions

View File

@ -95,9 +95,12 @@ class CacheClass(BaseCache):
self._lock.reader_leaves() self._lock.reader_leaves()
self._lock.writer_enters() self._lock.writer_enters()
try:
try: try:
del self._cache[key] del self._cache[key]
del self._expire_info[key] del self._expire_info[key]
except KeyError:
pass
return False return False
finally: finally:
self._lock.writer_leaves() self._lock.writer_leaves()