]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Remove private _PyGILState_GetInterpreterStateUnsafe() (#108603)
authorVictor Stinner <vstinner@python.org>
Tue, 29 Aug 2023 02:44:38 +0000 (04:44 +0200)
committerGitHub <noreply@github.com>
Tue, 29 Aug 2023 02:44:38 +0000 (02:44 +0000)
The remove private _PyGILState_GetInterpreterStateUnsafe() function
from the public C API: move it the internal C API (pycore_pystate.h).
No longer export the function.

Include/cpython/pystate.h
Include/internal/pycore_pystate.h

index 2a53838314c9d76ce7d6a38a1b457d9ab924e88d..fc5f58db86dbe87d06a7fe855edb9d301b15c45c 100644 (file)
@@ -227,15 +227,6 @@ PyAPI_FUNC(void) PyThreadState_LeaveTracing(PyThreadState *tstate);
    The function returns 1 if _PyGILState_check_enabled is non-zero. */
 PyAPI_FUNC(int) PyGILState_Check(void);
 
-/* Get the single PyInterpreterState used by this process' GILState
-   implementation.
-
-   This function doesn't check for error. Return NULL before _PyGILState_Init()
-   is called and after _PyGILState_Fini() is called.
-
-   See also PyInterpreterState_Get() and _PyInterpreterState_GET(). */
-PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void);
-
 /* Routines for advanced debuggers, requested by David Beazley.
    Don't use unless you know what you are doing! */
 PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void);
index 2e601cc6c4a464199d380c1937f9bf3a9a7648e9..a30036aeb57e05f083dc9e0e1776929d40a01ea0 100644 (file)
@@ -174,6 +174,14 @@ extern int _PyOS_InterruptOccurred(PyThreadState *tstate);
 // Export for test_peg_generator.
 PyAPI_FUNC(const PyConfig*) _Py_GetConfig(void);
 
+// Get the single PyInterpreterState used by this process' GILState
+// implementation.
+//
+// This function doesn't check for error. Return NULL before _PyGILState_Init()
+// is called and after _PyGILState_Fini() is called.
+//
+// See also PyInterpreterState_Get() and _PyInterpreterState_GET().
+extern PyInterpreterState* _PyGILState_GetInterpreterStateUnsafe(void);
 
 #ifdef __cplusplus
 }