summaryrefslogtreecommitdiff
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-19 02:41:21 +0100
committerGitHub <noreply@github.com>2020-03-19 02:41:21 +0100
commit50e6e991781db761c496561a995541ca8d83ff87 (patch)
tree3380890960438581d8262ad24e2c8b346d664c87 /Doc/whatsnew
parent3cde88439d542ed8ca6395acc8dfffd174ecca18 (diff)
downloadcpython-git-50e6e991781db761c496561a995541ca8d83ff87.tar.gz
bpo-39984: Move pending calls to PyInterpreterState (GH-19066)
If Py_AddPendingCall() is called in a subinterpreter, the function is now scheduled to be called from the subinterpreter, rather than being called from the main interpreter. Each subinterpreter now has its own list of scheduled calls. * Move pending and eval_breaker fields from _PyRuntimeState.ceval to PyInterpreterState.ceval. * new_interpreter() now calls _PyEval_InitThreads() to create pending calls lock. * Fix Py_AddPendingCall() for subinterpreters. It now calls _PyThreadState_GET() which works in a subinterpreter if the caller holds the GIL, and only falls back on PyGILState_GetThisThreadState() if _PyThreadState_GET() returns NULL.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.9.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index 6a6d1ee38c..5e8cdf585f 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -514,6 +514,12 @@ Build and C API Changes
Extension modules without module state (``m_size <= 0``) are not affected.
+* If :c:func:`Py_AddPendingCall` is called in a subinterpreter, the function is
+ now scheduled to be called from the subinterpreter, rather than being called
+ from the main interpreter. Each subinterpreter now has its own list of
+ scheduled calls.
+ (Contributed by Victor Stinner in :issue:`39984`.)
+
Deprecated
==========