Skip to content

Commit

Permalink
Fixed #9644: fix a thread sync issue in the locmem cache. Thanks, mrts.
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10333 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed Apr 1, 2009
1 parent 3e6f467 commit 644e981
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions django/core/cache/backends/locmem.py
Expand Up @@ -58,8 +58,11 @@ def get(self, key, default=None):
self._lock.reader_leaves() self._lock.reader_leaves()
self._lock.writer_enters() self._lock.writer_enters()
try: try:
del self._cache[key] try:
del self._expire_info[key] del self._cache[key]
del self._expire_info[key]
except KeyError:
pass
return default return default
finally: finally:
self._lock.writer_leaves() self._lock.writer_leaves()
Expand Down

0 comments on commit 644e981

Please sign in to comment.