diff options
author | Raymond Hettinger <python@rcn.com> | 2013-03-01 03:48:30 -0800 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2013-03-01 03:48:30 -0800 |
commit | 6d51e981bef7a7db65c80f7580fb700b08ae9d22 (patch) | |
tree | 9858049939edb4b04417c91413bbf84df64d490f /Lib/functools.py | |
parent | 3fd3f74571f4701747b19de0bcab4f53413ea89b (diff) | |
parent | 8a7c195add0c2b81620067072762554ac98ae9fb (diff) | |
download | cpython-6d51e981bef7a7db65c80f7580fb700b08ae9d22.tar.gz |
Merge
Diffstat (limited to 'Lib/functools.py')
-rw-r--r-- | Lib/functools.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/functools.py b/Lib/functools.py index 2647f2da79..c71d71420b 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -17,9 +17,9 @@ except ImportError: pass from collections import namedtuple try: - from _thread import allocate_lock as Lock + from _thread import RLock except: - from _dummy_thread import allocate_lock as Lock + from dummy_threading import RLock ################################################################################ @@ -232,7 +232,7 @@ def lru_cache(maxsize=128, typed=False): hits = misses = 0 full = False cache_get = cache.get # bound method to lookup a key or return None - lock = Lock() # because linkedlist updates aren't threadsafe + lock = RLock() # because linkedlist updates aren't threadsafe root = [] # root of the circular doubly linked list root[:] = [root, root, None, None] # initialize by pointing to self |