Skip to content

Commit 07cf33e

Browse files
authored
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.
1 parent 8d8bf0b commit 07cf33e

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Include/cpython/pythread.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44

55
#define PYTHREAD_INVALID_THREAD_ID ((unsigned long)-1)
66

7-
#ifdef HAVE_FORK
8-
/* Private function to reinitialize a lock at fork in the child process.
9-
Reset the lock to the unlocked state.
10-
Return 0 on success, return -1 on error. */
11-
PyAPI_FUNC(int) _PyThread_at_fork_reinit(PyThread_type_lock *lock);
12-
#endif /* HAVE_FORK */
13-
147
#ifdef HAVE_PTHREAD_H
158
/* Darwin needs pthread.h to know type name the pthread_key_t. */
169
# include <pthread.h>

Include/internal/pycore_pythread.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ struct _pythread_runtime_state {
7575
};
7676

7777

78+
#ifdef HAVE_FORK
79+
/* Private function to reinitialize a lock at fork in the child process.
80+
Reset the lock to the unlocked state.
81+
Return 0 on success, return -1 on error. */
82+
extern int _PyThread_at_fork_reinit(PyThread_type_lock *lock);
83+
#endif /* HAVE_FORK */
84+
85+
7886
#ifdef __cplusplus
7987
}
8088
#endif

0 commit comments

Comments
 (0)