Skip to content

bpo-37127: Remove _pending_calls.finishing #19439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Include/internal/pycore_pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ extern "C" {
/* ceval state */

struct _pending_calls {
int finishing;
PyThread_type_lock lock;
/* Request for running pending calls. */
_Py_atomic_int calls_to_do;
Expand Down
16 changes: 0 additions & 16 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,18 +547,6 @@ _PyEval_AddPendingCall(PyThreadState *tstate,
assert(pending->lock != NULL);

PyThread_acquire_lock(pending->lock, WAIT_LOCK);
if (pending->finishing) {
PyThread_release_lock(pending->lock);

PyObject *exc, *val, *tb;
_PyErr_Fetch(tstate, &exc, &val, &tb);
_PyErr_SetString(tstate, PyExc_SystemError,
"Py_AddPendingCall: cannot add pending calls "
"(Python shutting down)");
_PyErr_Print(tstate);
_PyErr_Restore(tstate, exc, val, tb);
return -1;
}
int result = _push_pending_call(pending, func, arg);
PyThread_release_lock(pending->lock);

Expand Down Expand Up @@ -666,10 +654,6 @@ _Py_FinishPendingCalls(PyThreadState *tstate)

struct _pending_calls *pending = &tstate->interp->ceval.pending;

PyThread_acquire_lock(pending->lock, WAIT_LOCK);
pending->finishing = 1;
PyThread_release_lock(pending->lock);

if (!_Py_atomic_load_relaxed(&(pending->calls_to_do))) {
return;
}
Expand Down