From 6961bd690e617b963a55ce86a640eedb590bc23b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 17 Aug 2010 22:26:51 +0000 Subject: [PATCH] Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx(). --- Misc/NEWS | 2 ++ Python/pythonrun.c | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index 4e119228678..586aa7e0e7e 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,8 @@ What's New in Python 3.2 Alpha 2? Core and Builtins ----------------- +- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx(). + - Issue #9612: The set object is now 64-bit clean under Windows. - Issue #8202: sys.argv[0] is now set to '-m' instead of '-c' when searching diff --git a/Python/pythonrun.c b/Python/pythonrun.c index a7a54ba7101..76a8eef2df4 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -206,6 +206,11 @@ Py_InitializeEx(int install_sigs) Py_FatalError("Py_Initialize: can't make first thread"); (void) PyThreadState_Swap(tstate); + /* auto-thread-state API, if available */ +#ifdef WITH_THREAD + _PyGILState_Init(interp, tstate); +#endif /* WITH_THREAD */ + _Py_ReadyTypes(); if (!_PyFrame_Init()) @@ -288,11 +293,6 @@ Py_InitializeEx(int install_sigs) Py_FatalError( "Py_Initialize: can't initialize sys standard streams"); - /* auto-thread-state API, if available */ -#ifdef WITH_THREAD - _PyGILState_Init(interp, tstate); -#endif /* WITH_THREAD */ - if (!Py_NoSiteFlag) initsite(); /* Module site */ }