mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
GH-96177: Move GIL and eval breaker code out of ceval.c into ceval_gil.c. (GH-96204)
This commit is contained in:
parent
4de06e3cc0
commit
a4a9f2e879
12 changed files with 1005 additions and 985 deletions
|
|
@ -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)");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue