Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dacb6858
Commit
dacb6858
authored
Mar 01, 2013
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
0580cbb1
fd54117a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Lib/functools.py
Lib/functools.py
+3
-3
No files found.
Lib/functools.py
View file @
dacb6858
...
...
@@ -17,9 +17,9 @@ except ImportError:
pass
from
collections
import
namedtuple
try
:
from
_thread
import
allocate_lock
as
Lock
from
_thread
import
R
Lock
except
:
from
_dummy_thread
import
allocate_lock
as
Lock
from
dummy_threading
import
R
Lock
################################################################################
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment