mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
bpo-46008: Move thread-related interpreter state into a sub-struct. (gh-29971)
This parallels _PyRuntimeState.interpreters. Doing this helps make it more clear what part of PyInterpreterState relates to its threads. https://bugs.python.org/issue46008
This commit is contained in:
parent
8262c96bcc
commit
313f92a57b
8 changed files with 42 additions and 40 deletions
|
@ -784,7 +784,7 @@ Py_SetRecursionLimit(int new_limit)
|
|||
{
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
interp->ceval.recursion_limit = new_limit;
|
||||
for (PyThreadState *p = interp->tstate_head; p != NULL; p = p->next) {
|
||||
for (PyThreadState *p = interp->threads.head; p != NULL; p = p->next) {
|
||||
int depth = p->recursion_limit - p->recursion_remaining;
|
||||
p->recursion_limit = new_limit;
|
||||
p->recursion_remaining = new_limit - depth;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue