django/django — pull request #3347 by tchaumeny (2014-10-12 13:43:24+00:00)
Title: Fixed #23642 -- Made LocMemCache.incr() atomic as documented

See https://code.djangoproject.com/ticket/23642, the following script generated random results before the patch:
```Python
import threading

from django.core.cache.backends.locmem import LocMemCache

cache = LocMemCache('test', {})

cache.set('foo', 0)

def increment(key):
cache.incr(key)

threads = []
for i in range(20):
t = threading.Thread(target=increment, args=('foo',))
t.start()
threads.append(t)

for t in threads:
t.join()

print cache.get('foo') # Random results — 20 is expected
```