diff options
author | Mark Shannon <mark@hotpy.org> | 2022-08-24 13:21:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-24 13:21:01 (GMT) |
commit | a4a9f2e879c0c9572e0cecbc702dc1dd31f80221 (patch) | |
tree | b79b68685fcff680ea2986b263cbb43b1c068bf2 /Include | |
parent | 4de06e3cc0a58d73934f9a2759ad9cd2f6b031b0 (diff) | |
download | cpython-a4a9f2e879c0c9572e0cecbc702dc1dd31f80221.zip cpython-a4a9f2e879c0c9572e0cecbc702dc1dd31f80221.tar.gz cpython-a4a9f2e879c0c9572e0cecbc702dc1dd31f80221.tar.bz2 |
GH-96177: Move GIL and eval breaker code out of ceval.c into ceval_gil.c. (GH-96204)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_ceval.h | 3 | ||||
-rw-r--r-- | Include/internal/pycore_pystate.h | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index 1b99930..2fcdaad 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -133,6 +133,9 @@ extern struct _PyInterpreterFrame* _PyEval_GetFrame(void); extern PyObject* _Py_MakeCoro(PyFunctionObject *func); +extern int _Py_HandlePending(PyThreadState *tstate); + + #ifdef __cplusplus } #endif diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index 51d119c..3d6d400 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -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)"); } } |