]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Remove private _PyThread_at_fork_reinit() function (#108601)
authorVictor Stinner <vstinner@python.org>
Tue, 29 Aug 2023 02:38:23 +0000 (04:38 +0200)
committerGitHub <noreply@github.com>
Tue, 29 Aug 2023 02:38:23 +0000 (02:38 +0000)
Move the private function to the internal C API (pycore_pythread.h)
and no longer exports it.

Include/cpython/pythread.h
Include/internal/pycore_pythread.h

index ce4ec8f65b15ea016a86c6e2452560e3b6ecb47b..cd2aab72d52df30f40c62b2cf28f13dba4f44ad6 100644 (file)
@@ -4,13 +4,6 @@
 
 #define PYTHREAD_INVALID_THREAD_ID ((unsigned long)-1)
 
-#ifdef HAVE_FORK
-/* Private function to reinitialize a lock at fork in the child process.
-   Reset the lock to the unlocked state.
-   Return 0 on success, return -1 on error. */
-PyAPI_FUNC(int) _PyThread_at_fork_reinit(PyThread_type_lock *lock);
-#endif  /* HAVE_FORK */
-
 #ifdef HAVE_PTHREAD_H
     /* Darwin needs pthread.h to know type name the pthread_key_t. */
 #   include <pthread.h>
index 44846c0fc4b4c34dcb6b53ca14807f1892f5e910..5ec2abda91e86bdfeb8674307c7a147443840d33 100644 (file)
@@ -75,6 +75,14 @@ struct _pythread_runtime_state {
 };
 
 
+#ifdef HAVE_FORK
+/* Private function to reinitialize a lock at fork in the child process.
+   Reset the lock to the unlocked state.
+   Return 0 on success, return -1 on error. */
+extern int _PyThread_at_fork_reinit(PyThread_type_lock *lock);
+#endif  /* HAVE_FORK */
+
+
 #ifdef __cplusplus
 }
 #endif