diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-02-06 21:39:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-06 21:39:25 (GMT) |
commit | 132b3f8302c021ac31e9c1797a127d57faa1afee (patch) | |
tree | cd79634eca0a8d381f1ce76df83da94c5df7d4fe /Lib/test/test_httpservers.py | |
parent | 262003fd3297f7f4ee09cebd1abb225066412ce7 (diff) | |
download | cpython-132b3f8302c021ac31e9c1797a127d57faa1afee.zip cpython-132b3f8302c021ac31e9c1797a127d57faa1afee.tar.gz cpython-132b3f8302c021ac31e9c1797a127d57faa1afee.tar.bz2 |
gh-59956: Partial Fix for GILState API Compatibility with Subinterpreters (gh-101431)
The GILState API (PEP 311) implementation from 2003 made the assumption that only one thread state would ever be used for any given OS thread, explicitly disregarding the case of subinterpreters. However, PyThreadState_Swap() still facilitated switching between subinterpreters, meaning the "current" thread state (holding the GIL), and the GILState thread state could end up out of sync, causing problems (including crashes).
This change addresses the issue by keeping the two in sync in PyThreadState_Swap(). I verified the fix against gh-99040.
Note that the other GILState-subinterpreter incompatibility (with autoInterpreterState) is not resolved here.
https://github.com/python/cpython/issues/59956
Diffstat (limited to 'Lib/test/test_httpservers.py')
0 files changed, 0 insertions, 0 deletions