summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-06-13 21:02:19 (GMT)
committerGitHub <noreply@github.com>2023-06-13 21:02:19 (GMT)
commit757b402ea1c2c6b925a55a08fd844b065b6e082f (patch)
treecf4f2ea1aff52a2c7faa7181f3f9af01f732830f /Python/pystate.c
parent4e80082723b768df124f77d2b73b3ba6b584a735 (diff)
downloadcpython-757b402ea1c2c6b925a55a08fd844b065b6e082f.zip
cpython-757b402ea1c2c6b925a55a08fd844b065b6e082f.tar.gz
cpython-757b402ea1c2c6b925a55a08fd844b065b6e082f.tar.bz2
gh-104812: Run Pending Calls in any Thread (gh-104813)
For a while now, pending calls only run in the main thread (in the main interpreter). This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index fb95825..52d6b29 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -380,7 +380,7 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
static const _PyRuntimeState initial = _PyRuntimeState_INIT(_PyRuntime);
_Py_COMP_DIAG_POP
-#define NUMLOCKS 8
+#define NUMLOCKS 9
#define LOCKS_INIT(runtime) \
{ \
&(runtime)->interpreters.mutex, \
@@ -388,6 +388,7 @@ _Py_COMP_DIAG_POP
&(runtime)->getargs.mutex, \
&(runtime)->unicode_state.ids.lock, \
&(runtime)->imports.extensions.mutex, \
+ &(runtime)->ceval.pending_mainthread.lock, \
&(runtime)->atexit.mutex, \
&(runtime)->audit_hooks.mutex, \
&(runtime)->allocators.mutex, \