Browse Source

check if the thread is finalizing after retaking the GIL

pull/224/head
Benjamin Peterson 12 years ago
parent
commit
17548dda51
  1. 7
      Python/ceval.c

7
Python/ceval.c

@ -1267,6 +1267,13 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
/* Other threads may run now */
take_gil(tstate);
/* Check if we should make a quick exit. */
if (_Py_Finalizing && _Py_Finalizing != tstate) {
drop_gil(tstate);
PyThread_exit_thread();
}
if (PyThreadState_Swap(tstate) != NULL)
Py_FatalError("ceval: orphan tstate");
}

Loading…
Cancel
Save