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
79ee3cd6
Commit
79ee3cd6
authored
Jan 15, 2011
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the GIL with subinterpreters. Hopefully this will allow mod_wsgi to work with 3.2.
(we need some tests for this)
parent
eac6a0dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
Python/ceval_gil.h
Python/ceval_gil.h
+7
-4
No files found.
Python/ceval_gil.h
View file @
79ee3cd6
...
...
@@ -334,12 +334,15 @@ static void recreate_gil(void)
static
void
drop_gil
(
PyThreadState
*
tstate
)
{
/* NOTE: tstate is allowed to be NULL. */
if
(
!
_Py_atomic_load_relaxed
(
&
gil_locked
))
Py_FatalError
(
"drop_gil: GIL is not locked"
);
if
(
tstate
!=
NULL
&&
tstate
!=
_Py_atomic_load_relaxed
(
&
gil_last_holder
))
Py_FatalError
(
"drop_gil: wrong thread state"
);
/* tstate is allowed to be NULL (early interpreter init) */
if
(
tstate
!=
NULL
)
{
/* Sub-interpreter support: threads might have been switched
under our feet using PyThreadState_Swap(). Fix the GIL last
holder variable so that our heuristics work. */
_Py_atomic_store_relaxed
(
&
gil_last_holder
,
tstate
);
}
MUTEX_LOCK
(
gil_mutex
);
_Py_ANNOTATE_RWLOCK_RELEASED
(
&
gil_locked
,
/*is_write=*/
1
);
...
...
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