summaryrefslogtreecommitdiffstats
path: root/Modules/_threadmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2019-11-20 01:27:56 (GMT)
committerGitHub <noreply@github.com>2019-11-20 01:27:56 (GMT)
commit01b1cc12e7c6a3d6a3d27ba7c731687d57aae92a (patch)
tree1d1afefdc486c063853678d126975fe2d019059f /Modules/_threadmodule.c
parenteb1cbbff1cd8214836a492502e75e463ade6f673 (diff)
downloadcpython-01b1cc12e7c6a3d6a3d27ba7c731687d57aae92a.zip
cpython-01b1cc12e7c6a3d6a3d27ba7c731687d57aae92a.tar.gz
cpython-01b1cc12e7c6a3d6a3d27ba7c731687d57aae92a.tar.bz2
bpo-36710: Add PyInterpreterState.runtime field (GH-17270)
Add PyInterpreterState.runtime field: reference to the _PyRuntime global variable. This field exists to not have to pass runtime in addition to tstate to a function. Get runtime from tstate: tstate->interp->runtime. Remove "_PyRuntimeState *runtime" parameter from functions already taking a "PyThreadState *tstate" parameter. _PyGC_Init() first parameter becomes "PyThreadState *tstate".
Diffstat (limited to 'Modules/_threadmodule.c')
-rw-r--r--Modules/_threadmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index 1c7df3f..befd213 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -1007,7 +1007,7 @@ t_bootstrap(void *boot_raw)
runtime = boot->runtime;
tstate = boot->tstate;
tstate->thread_id = PyThread_get_thread_ident();
- _PyThreadState_Init(runtime, tstate);
+ _PyThreadState_Init(tstate);
PyEval_AcquireThread(tstate);
tstate->interp->num_threads++;
res = PyObject_Call(boot->func, boot->args, boot->keyw);