summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-13 10:35:37 (GMT)
committerGitHub <noreply@github.com>2019-05-13 10:35:37 (GMT)
commitd5d9e81ce9a7efc5bc14a5c21398d1ef6f626884 (patch)
tree0650e31fe590d6be19dc21546cd129d68139d4af /Modules/posixmodule.c
parent3aef48e3157f52a8bcdbacf47a35d0016348735e (diff)
downloadcpython-d5d9e81ce9a7efc5bc14a5c21398d1ef6f626884.zip
cpython-d5d9e81ce9a7efc5bc14a5c21398d1ef6f626884.tar.gz
cpython-d5d9e81ce9a7efc5bc14a5c21398d1ef6f626884.tar.bz2
bpo-36728: Remove PyEval_ReInitThreads() from C API (GH-13241)
Remove the PyEval_ReInitThreads() function from the Python C API. It should not be called explicitly: use PyOS_AfterFork_Child() instead. Rename PyEval_ReInitThreads() to _PyEval_ReInitThreads() and add a 'runtime' parameter.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index aa77094..aca64ef 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -25,14 +25,25 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+#ifdef MS_WINDOWS
+ /* include <windows.h> early to avoid conflict with pycore_condvar.h:
+
+ #define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
+
+ FSCTL_GET_REPARSE_POINT is not exported with WIN32_LEAN_AND_MEAN. */
+# include <windows.h>
+#endif
+
+#include "pycore_ceval.h" /* _PyEval_ReInitThreads() */
+#include "pycore_pystate.h" /* _PyRuntime */
#include "pythread.h"
#include "structmember.h"
#ifndef MS_WINDOWS
-#include "posixmodule.h"
+# include "posixmodule.h"
#else
-#include "winreparse.h"
+# include "winreparse.h"
#endif
-#include "pycore_pystate.h"
/* On android API level 21, 'AT_EACCESS' is not declared although
* HAVE_FACCESSAT is defined. */
@@ -424,7 +435,7 @@ PyOS_AfterFork_Child(void)
_PyRuntimeState *runtime = &_PyRuntime;
_PyGILState_Reinit(runtime);
_PyInterpreterState_DeleteExceptMain(runtime);
- PyEval_ReInitThreads();
+ _PyEval_ReInitThreads(runtime);
_PyImport_ReInitLock();
_PySignal_AfterFork();
_PyRuntimeState_ReInitThreads(runtime);