From 07cf33ef24053eb101f56f0c311164b59d50157b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 29 Aug 2023 04:38:23 +0200 Subject: gh-106320: Remove private _PyThread_at_fork_reinit() function (#108601) Move the private function to the internal C API (pycore_pythread.h) and no longer exports it. --- Include/cpython/pythread.h | 7 ------- Include/internal/pycore_pythread.h | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Include/cpython/pythread.h b/Include/cpython/pythread.h index ce4ec8f..cd2aab7 100644 --- a/Include/cpython/pythread.h +++ b/Include/cpython/pythread.h @@ -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 diff --git a/Include/internal/pycore_pythread.h b/Include/internal/pycore_pythread.h index 44846c0..5ec2abd 100644 --- a/Include/internal/pycore_pythread.h +++ b/Include/internal/pycore_pythread.h @@ -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 -- cgit v0.12