mirror of
https://github.com/python/cpython.git
synced 2025-10-12 09:53:19 +00:00
Merge
This commit is contained in:
commit
dacb6858e8
1 changed files with 3 additions and 3 deletions
|
@ -17,9 +17,9 @@ except ImportError:
|
||||||
pass
|
pass
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
try:
|
try:
|
||||||
from _thread import allocate_lock as Lock
|
from _thread import RLock
|
||||||
except:
|
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
|
hits = misses = 0
|
||||||
full = False
|
full = False
|
||||||
cache_get = cache.get # bound method to lookup a key or return None
|
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 of the circular doubly linked list
|
||||||
root[:] = [root, root, None, None] # initialize by pointing to self
|
root[:] = [root, root, None, None] # initialize by pointing to self
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue