]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Remove private _PyOS_IsMainThread() function (#108605)
authorVictor Stinner <vstinner@python.org>
Tue, 29 Aug 2023 03:20:31 +0000 (05:20 +0200)
committerGitHub <noreply@github.com>
Tue, 29 Aug 2023 03:20:31 +0000 (03:20 +0000)
Move the following private API to the internal C API
(pycore_signal.h): _PyOS_IsMainThread() and _PyOS_SigintEvent().

Include/internal/pycore_signal.h
Include/intrcheck.h

index 8f876759c0d07f6a751464eab6696469bb0a21a4..b38b1d30112b60e769c9dcaf6b384a40e4e48893 100644 (file)
@@ -95,6 +95,15 @@ struct _signals_runtime_state {
     }
 
 
+// Export for '_multiprocessing' shared extension
+PyAPI_FUNC(int) _PyOS_IsMainThread(void);
+
+#ifdef MS_WINDOWS
+// <windows.h> is not included by Python.h so use void* instead of HANDLE.
+// Export for '_multiprocessing' shared extension
+PyAPI_FUNC(void*) _PyOS_SigintEvent(void);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index b8cc65601683cba552aad8eb0208c04f833470e1..1d1feee83de483033212e158aa4a131b2cc17cd8 100644 (file)
@@ -5,6 +5,7 @@ extern "C" {
 #endif
 
 PyAPI_FUNC(int) PyOS_InterruptOccurred(void);
+
 #ifdef HAVE_FORK
 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
 PyAPI_FUNC(void) PyOS_BeforeFork(void);
@@ -12,18 +13,10 @@ PyAPI_FUNC(void) PyOS_AfterFork_Parent(void);
 PyAPI_FUNC(void) PyOS_AfterFork_Child(void);
 #endif
 #endif
+
 /* Deprecated, please use PyOS_AfterFork_Child() instead */
 Py_DEPRECATED(3.7) PyAPI_FUNC(void) PyOS_AfterFork(void);
 
-#ifndef Py_LIMITED_API
-PyAPI_FUNC(int) _PyOS_IsMainThread(void);
-
-#ifdef MS_WINDOWS
-/* windows.h is not included by Python.h so use void* instead of HANDLE */
-PyAPI_FUNC(void*) _PyOS_SigintEvent(void);
-#endif
-#endif /* !Py_LIMITED_API */
-
 #ifdef __cplusplus
 }
 #endif