Skip to content

Commit f3eaba7

Browse files
committed
gh-106320: Remove private _PyOS_IsMainThread() function
Move the following private API to the internal C API (pycore_signal.h): _PyOS_IsMainThread() and _PyOS_SigintEvent().
1 parent 8d8bf0b commit f3eaba7

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Include/internal/pycore_signal.h

+9
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ struct _signals_runtime_state {
9595
}
9696

9797

98+
// Export for '_multiprocessing' shared extension
99+
PyAPI_FUNC(int) _PyOS_IsMainThread(void);
100+
101+
#ifdef MS_WINDOWS
102+
// <windows.h> is not included by Python.h so use void* instead of HANDLE.
103+
// Export for '_multiprocessing' shared extension
104+
PyAPI_FUNC(void*) _PyOS_SigintEvent(void);
105+
#endif
106+
98107
#ifdef __cplusplus
99108
}
100109
#endif

Include/intrcheck.h

+2-9
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,18 @@ extern "C" {
55
#endif
66

77
PyAPI_FUNC(int) PyOS_InterruptOccurred(void);
8+
89
#ifdef HAVE_FORK
910
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
1011
PyAPI_FUNC(void) PyOS_BeforeFork(void);
1112
PyAPI_FUNC(void) PyOS_AfterFork_Parent(void);
1213
PyAPI_FUNC(void) PyOS_AfterFork_Child(void);
1314
#endif
1415
#endif
16+
1517
/* Deprecated, please use PyOS_AfterFork_Child() instead */
1618
Py_DEPRECATED(3.7) PyAPI_FUNC(void) PyOS_AfterFork(void);
1719

18-
#ifndef Py_LIMITED_API
19-
PyAPI_FUNC(int) _PyOS_IsMainThread(void);
20-
21-
#ifdef MS_WINDOWS
22-
/* windows.h is not included by Python.h so use void* instead of HANDLE */
23-
PyAPI_FUNC(void*) _PyOS_SigintEvent(void);
24-
#endif
25-
#endif /* !Py_LIMITED_API */
26-
2720
#ifdef __cplusplus
2821
}
2922
#endif

0 commit comments

Comments
 (0)