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
81669697
Commit
81669697
authored
Jun 16, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid a deadlock with the interpreter head lock and the GIL during finalization
parent
1c78e6d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
Python/pystate.c
Python/pystate.c
+8
-1
No files found.
Python/pystate.c
View file @
81669697
...
...
@@ -315,7 +315,14 @@ PyThreadState_DeleteCurrent()
Py_FatalError
(
"PyThreadState_DeleteCurrent: no current tstate"
);
_PyThreadState_Current
=
NULL
;
tstate_delete_common
(
tstate
);
/*
Only call tstate_delete_common to have the tstate if we're not finalizing
or we're the main thread. The main thread will do this for us. Not calling
tstate_delete_common means we won't lock the interpreter head lock,
avoiding a possible deadlock with the GIL.
*/
if
(
!
_Py_Finalizing
||
_Py_Finalizing
==
tstate
)
tstate_delete_common
(
tstate
);
if
(
autoInterpreterState
&&
PyThread_get_key_value
(
autoTLSkey
)
==
tstate
)
PyThread_delete_key_value
(
autoTLSkey
);
PyEval_ReleaseLock
();
...
...
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