GH-96177: Move GIL and eval breaker code out of ceval.c into ceval_gil.c. (GH-96204)

This commit is contained in:
Mark Shannon 2022-08-24 14:21:01 +01:00 committed by GitHub
parent 4de06e3cc0
commit a4a9f2e879
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1005 additions and 985 deletions

View file

@ -85,13 +85,14 @@ _PyThreadState_GET(void)
return _PyRuntimeState_GetThreadState(&_PyRuntime);
}
PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalError_TstateNULL(const char *func);
static inline void
_Py_EnsureFuncTstateNotNULL(const char *func, PyThreadState *tstate)
{
if (tstate == NULL) {
_Py_FatalError_TstateNULL(func);
_Py_FatalErrorFunc(func,
"the function must be called with the GIL held, "
"after Python initialization and before Python finalization, "
"but the GIL is released (the current Python thread state is NULL)");
}
}