Skip to content

Commit 2b1df45

Browse files
authored
bpo-38644: Pass tstate to _Py_FinishPendingCalls() (GH-17990)
_Py_FinishPendingCalls() now expects a tstate argument, instead of a runtime argument.
1 parent 3430c55 commit 2b1df45

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Include/internal/pycore_ceval.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct _frame;
1515

1616
#include "pycore_pystate.h" /* PyInterpreterState.eval_frame */
1717

18-
PyAPI_FUNC(void) _Py_FinishPendingCalls(struct pyruntimestate *runtime);
18+
PyAPI_FUNC(void) _Py_FinishPendingCalls(PyThreadState *tstate);
1919
PyAPI_FUNC(void) _PyEval_Initialize(struct _ceval_runtime_state *);
2020
PyAPI_FUNC(void) _PyEval_FiniThreads(
2121
struct _ceval_runtime_state *ceval);

Python/ceval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,11 +585,11 @@ make_pending_calls(_PyRuntimeState *runtime)
585585
}
586586

587587
void
588-
_Py_FinishPendingCalls(_PyRuntimeState *runtime)
588+
_Py_FinishPendingCalls(PyThreadState *tstate)
589589
{
590590
assert(PyGILState_Check());
591591

592-
PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime);
592+
_PyRuntimeState *runtime = tstate->interp->runtime;
593593
struct _pending_calls *pending = &runtime->ceval.pending;
594594

595595
PyThread_acquire_lock(pending->lock, WAIT_LOCK);

Python/pylifecycle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ Py_FinalizeEx(void)
13401340
wait_for_thread_shutdown(tstate);
13411341

13421342
// Make any remaining pending calls.
1343-
_Py_FinishPendingCalls(runtime);
1343+
_Py_FinishPendingCalls(tstate);
13441344

13451345
/* The interpreter is still entirely intact at this point, and the
13461346
* exit funcs may be relying on that. In particular, if some thread

0 commit comments

Comments
 (0)