diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-06-03 18:14:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-03 18:14:24 +0200 |
commit | e225bebc1409bcf68db74a35ed3c31222883bf8f (patch) | |
tree | 42153d2d48a3f1c784812b4fb54ed3557be713d0 /Python/pylifecycle.c | |
parent | 49a7e347976c9b39149ac7505b11ad6e9e2bdeec (diff) | |
download | cpython-git-e225bebc1409bcf68db74a35ed3c31222883bf8f.tar.gz |
Revert "bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (gh-13714)" (GH-13780)
This reverts commit 6a150bcaeb190d1731b38ab9c7a5d1a352847ddc.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index fc7e5510b2..fca2ee6551 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1147,31 +1147,15 @@ Py_FinalizeEx(void) return status; } - /* Get current thread state and interpreter pointer */ - PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); - PyInterpreterState *interp = tstate->interp; - // Wrap up existing "threading"-module-created, non-daemon threads. wait_for_thread_shutdown(); // Make any remaining pending calls. - /* XXX For the moment we are going to ignore lingering pending calls. - * We've seen sporadic on some of the buildbots during finalization - * with the changes for per-interpreter pending calls (see bpo-33608), - * meaning the previous _PyEval_FinishPendincCalls() call here is - * a trigger, if not responsible. - * - * Ignoring pending calls at this point in the runtime lifecycle - * is okay (for now) for the following reasons: - * - * * pending calls are still not a widely-used feature - * * this only affects runtime finalization, where the process is - * likely to end soon anyway (except for some embdding cases) - * - * See bpo-37127 about resolving the problem. Ultimately the call - * here should be re-enabled. - */ - //_PyEval_FinishPendingCalls(interp); + _Py_FinishPendingCalls(runtime); + + /* Get current thread state and interpreter pointer */ + PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); + PyInterpreterState *interp = tstate->interp; /* The interpreter is still entirely intact at this point, and the * exit funcs may be relying on that. In particular, if some thread @@ -1599,9 +1583,6 @@ Py_EndInterpreter(PyThreadState *tstate) // Wrap up existing "threading"-module-created, non-daemon threads. wait_for_thread_shutdown(); - // Make any remaining pending calls. - _PyEval_FinishPendingCalls(interp); - call_py_exitfuncs(interp); if (tstate != interp->tstate_head || tstate->next != NULL) |