summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-19 01:41:21 (GMT)
committerGitHub <noreply@github.com>2020-03-19 01:41:21 (GMT)
commit50e6e991781db761c496561a995541ca8d83ff87 (patch)
tree3380890960438581d8262ad24e2c8b346d664c87 /Misc
parent3cde88439d542ed8ca6395acc8dfffd174ecca18 (diff)
downloadcpython-50e6e991781db761c496561a995541ca8d83ff87.zip
cpython-50e6e991781db761c496561a995541ca8d83ff87.tar.gz
cpython-50e6e991781db761c496561a995541ca8d83ff87.tar.bz2
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 'Misc')
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-03-19-00-45-37.bpo-39984.u-bHIq.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-19-00-45-37.bpo-39984.u-bHIq.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-19-00-45-37.bpo-39984.u-bHIq.rst
new file mode 100644
index 0000000..57c7d15
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-03-19-00-45-37.bpo-39984.u-bHIq.rst
@@ -0,0 +1,4 @@
+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.