mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Revert: bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617) (GH-12159)
* Revert "bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as necessary). (#12003)" This reverts commitbcfa450f21
. * Revert "bpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. (gh-12062)" This reverts commitbda918bf65
. * Revert "bpo-33608: Use _Py_AddPendingCall() in _PyCrossInterpreterData_Release(). (gh-12024)" This reverts commitb05b711a2c
. * Revert "bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617)" This reverts commitef4ac967e2
.
This commit is contained in:
parent
f4b0a1c0da
commit
4d61e6e3b8
20 changed files with 582 additions and 751 deletions
|
@ -1460,32 +1460,8 @@ Py_EndInterpreter(PyThreadState *tstate)
|
|||
if (tstate->frame != NULL)
|
||||
Py_FatalError("Py_EndInterpreter: thread still has a frame");
|
||||
|
||||
// Mark as finalizing.
|
||||
if (interp->ceval.pending.lock != NULL) {
|
||||
PyThread_acquire_lock(interp->ceval.pending.lock, 1);
|
||||
}
|
||||
interp->finalizing = 1;
|
||||
if (interp->ceval.pending.lock != NULL) {
|
||||
PyThread_release_lock(interp->ceval.pending.lock);
|
||||
}
|
||||
|
||||
// Wrap up existing threads.
|
||||
wait_for_thread_shutdown();
|
||||
|
||||
// Make any pending calls.
|
||||
if (_Py_atomic_load_relaxed(
|
||||
&(interp->ceval.pending.calls_to_do)))
|
||||
{
|
||||
// XXX Ensure that the interpreter is running in the current thread?
|
||||
if (_Py_MakePendingCalls(interp) < 0) {
|
||||
PyObject *exc, *val, *tb;
|
||||
PyErr_Fetch(&exc, &val, &tb);
|
||||
PyErr_BadInternalCall();
|
||||
_PyErr_ChainExceptions(exc, val, tb);
|
||||
PyErr_Print();
|
||||
}
|
||||
}
|
||||
|
||||
call_py_exitfuncs(interp);
|
||||
|
||||
if (tstate != interp->tstate_head || tstate->next != NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue