Skip to content

Commit cfc3c2f

Browse files
authored
bpo-37127: Remove _pending_calls.finishing (GH-19439)
1 parent dda5d6e commit cfc3c2f

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

Include/internal/pycore_pystate.h

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ extern "C" {
1616
/* ceval state */
1717

1818
struct _pending_calls {
19-
int finishing;
2019
PyThread_type_lock lock;
2120
/* Request for running pending calls. */
2221
_Py_atomic_int calls_to_do;

Python/ceval.c

-16
Original file line numberDiff line numberDiff line change
@@ -547,18 +547,6 @@ _PyEval_AddPendingCall(PyThreadState *tstate,
547547
assert(pending->lock != NULL);
548548

549549
PyThread_acquire_lock(pending->lock, WAIT_LOCK);
550-
if (pending->finishing) {
551-
PyThread_release_lock(pending->lock);
552-
553-
PyObject *exc, *val, *tb;
554-
_PyErr_Fetch(tstate, &exc, &val, &tb);
555-
_PyErr_SetString(tstate, PyExc_SystemError,
556-
"Py_AddPendingCall: cannot add pending calls "
557-
"(Python shutting down)");
558-
_PyErr_Print(tstate);
559-
_PyErr_Restore(tstate, exc, val, tb);
560-
return -1;
561-
}
562550
int result = _push_pending_call(pending, func, arg);
563551
PyThread_release_lock(pending->lock);
564552

@@ -666,10 +654,6 @@ _Py_FinishPendingCalls(PyThreadState *tstate)
666654

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

669-
PyThread_acquire_lock(pending->lock, WAIT_LOCK);
670-
pending->finishing = 1;
671-
PyThread_release_lock(pending->lock);
672-
673657
if (!_Py_atomic_load_relaxed(&(pending->calls_to_do))) {
674658
return;
675659
}

0 commit comments

Comments
 (0)