[Python-checkins] r82666 - python/branches/import_unicode/Python/pythonrun.c

victor.stinner python-checkins at python.org
Fri Jul 9 01:32:14 CEST 2010


Author: victor.stinner
Date: Fri Jul  9 01:32:14 2010
New Revision: 82666

Log:
initialize GIL earlier in Py_InitializeEx()

Modified:
   python/branches/import_unicode/Python/pythonrun.c

Modified: python/branches/import_unicode/Python/pythonrun.c
==============================================================================
--- python/branches/import_unicode/Python/pythonrun.c	(original)
+++ python/branches/import_unicode/Python/pythonrun.c	Fri Jul  9 01:32:14 2010
@@ -206,6 +206,11 @@
         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())
@@ -286,11 +291,6 @@
         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 */
 }


More information about the Python-checkins mailing list