File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -990,6 +990,11 @@ Changes in the Python API
990990Changes in the C API
991991--------------------
992992
993+ * The :c:func: `PyEval_ReInitThreads ` function has been removed from the C API.
994+ It should not be called explicitly: use :c:func: `PyOS_AfterFork_Child `
995+ instead.
996+ (Contributed by Victor Stinner in :issue: `36728 `.)
997+
993998* On Unix, C extensions are no longer linked to libpython except on
994999 Android. When Python is embedded, ``libpython `` must not be loaded with
9951000 ``RTLD_LOCAL ``, but ``RTLD_GLOBAL `` instead. Previously, using
Original file line number Diff line number Diff line change @@ -195,7 +195,6 @@ PyAPI_FUNC(void) PyEval_AcquireLock(void) Py_DEPRECATED(3.2);
195195PyAPI_FUNC (void ) PyEval_ReleaseLock (void ) /* Py_DEPRECATED(3.2) */ ;
196196PyAPI_FUNC (void ) PyEval_AcquireThread (PyThreadState * tstate );
197197PyAPI_FUNC (void ) PyEval_ReleaseThread (PyThreadState * tstate );
198- PyAPI_FUNC (void ) PyEval_ReInitThreads (void );
199198
200199#ifndef Py_LIMITED_API
201200PyAPI_FUNC (void ) _PyEval_SetSwitchInterval (unsigned long microseconds );
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ PyAPI_FUNC(int) _PyEval_AddPendingCall(
2424 void * arg );
2525PyAPI_FUNC (void ) _PyEval_SignalAsyncExc (
2626 struct _ceval_runtime_state * ceval );
27+ PyAPI_FUNC (void ) _PyEval_ReInitThreads (
28+ _PyRuntimeState * runtime );
2729
2830#ifdef __cplusplus
2931}
Original file line number Diff line number Diff line change 1+ The :c:func: `PyEval_ReInitThreads ` function has been removed from the C API.
2+ It should not be called explicitly: use :c:func: `PyOS_AfterFork_Child ` instead.
Original file line number Diff line number Diff line change 2525#define PY_SSIZE_T_CLEAN
2626
2727#include "Python.h"
28+ #ifdef MS_WINDOWS
29+ /* include <windows.h> early to avoid conflict with pycore_condvar.h:
30+
31+ #define WIN32_LEAN_AND_MEAN
32+ #include <windows.h>
33+
34+ FSCTL_GET_REPARSE_POINT is not exported with WIN32_LEAN_AND_MEAN. */
35+ # include <windows.h>
36+ #endif
37+
38+ #include "pycore_ceval.h" /* _PyEval_ReInitThreads() */
39+ #include "pycore_pystate.h" /* _PyRuntime */
2840#include "pythread.h"
2941#include "structmember.h"
3042#ifndef MS_WINDOWS
31- #include "posixmodule.h"
43+ # include "posixmodule.h"
3244#else
33- #include "winreparse.h"
45+ # include "winreparse.h"
3446#endif
35- #include "pycore_pystate.h"
3647
3748/* On android API level 21, 'AT_EACCESS' is not declared although
3849 * HAVE_FACCESSAT is defined. */
@@ -424,7 +435,7 @@ PyOS_AfterFork_Child(void)
424435 _PyRuntimeState * runtime = & _PyRuntime ;
425436 _PyGILState_Reinit (runtime );
426437 _PyInterpreterState_DeleteExceptMain (runtime );
427- PyEval_ReInitThreads ( );
438+ _PyEval_ReInitThreads ( runtime );
428439 _PyImport_ReInitLock ();
429440 _PySignal_AfterFork ();
430441 _PyRuntimeState_ReInitThreads (runtime );
Original file line number Diff line number Diff line change @@ -289,9 +289,8 @@ PyEval_ReleaseThread(PyThreadState *tstate)
289289 */
290290
291291void
292- PyEval_ReInitThreads ( void )
292+ _PyEval_ReInitThreads ( _PyRuntimeState * runtime )
293293{
294- _PyRuntimeState * runtime = & _PyRuntime ;
295294 struct _ceval_runtime_state * ceval = & runtime -> ceval ;
296295 if (!gil_created (& ceval -> gil )) {
297296 return ;
You can’t perform that action at this time.
0 commit comments