@@ -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