mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
bpo-37127: Remove _pending_calls.finishing (GH-19439)
This commit is contained in:
parent
dda5d6e071
commit
cfc3c2f8b3
2 changed files with 0 additions and 17 deletions
|
@ -16,7 +16,6 @@ extern "C" {
|
||||||
/* ceval state */
|
/* ceval state */
|
||||||
|
|
||||||
struct _pending_calls {
|
struct _pending_calls {
|
||||||
int finishing;
|
|
||||||
PyThread_type_lock lock;
|
PyThread_type_lock lock;
|
||||||
/* Request for running pending calls. */
|
/* Request for running pending calls. */
|
||||||
_Py_atomic_int calls_to_do;
|
_Py_atomic_int calls_to_do;
|
||||||
|
|
|
@ -547,18 +547,6 @@ _PyEval_AddPendingCall(PyThreadState *tstate,
|
||||||
assert(pending->lock != NULL);
|
assert(pending->lock != NULL);
|
||||||
|
|
||||||
PyThread_acquire_lock(pending->lock, WAIT_LOCK);
|
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);
|
int result = _push_pending_call(pending, func, arg);
|
||||||
PyThread_release_lock(pending->lock);
|
PyThread_release_lock(pending->lock);
|
||||||
|
|
||||||
|
@ -666,10 +654,6 @@ _Py_FinishPendingCalls(PyThreadState *tstate)
|
||||||
|
|
||||||
struct _pending_calls *pending = &tstate->interp->ceval.pending;
|
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))) {
|
if (!_Py_atomic_load_relaxed(&(pending->calls_to_do))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue