Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
6bc64ff4
Commit
6bc64ff4
authored
Jul 15, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct attribute name under py3
parent
8f5252cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
gevent/monkey.py
gevent/monkey.py
+11
-6
No files found.
gevent/monkey.py
View file @
6bc64ff4
...
...
@@ -163,15 +163,20 @@ def _patch_existing_locks(threading):
# locked objects...at least if they use `with`. To be sure, we look at every object
# Since we're supposed to be done very early in the process, there shouldn't be
# too many.
# By definition there's only one thread running, so the various
# owner attributes were the old (native) thread id. Make it our
# current greenlet id so that when it wants to unlock and compare
# self.__owner with _get_ident(), they match.
gc
=
__import__
(
'gc'
)
for
o
in
gc
.
get_objects
():
if
isinstance
(
o
,
rlock_type
):
if
o
.
_RLock__owner
is
not
None
:
# By definition there's only one thread running,
# so this was the old (native) thread id. Make
# it our current greenlet id so that when it wants to unlock
# and compare self.__owner with _get_ident(), they match
o
.
_RLock__owner
=
tid
if
hasattr
(
o
,
'_owner'
):
# Py3
if
o
.
_owner
is
not
None
:
o
.
_owner
=
tid
else
:
if
o
.
_RLock__owner
is
not
None
:
o
.
_RLock__owner
=
tid
elif
isinstance
(
o
,
_ModuleLock
):
if
o
.
owner
is
not
None
:
o
.
owner
=
tid
...
...
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