Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 64133:686b18bffb86
Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Tue, 17 Aug 2010 22:26:51 +0000 |
| parents | 1bd3534136a0 |
| children | 687cc854cb4b |
comparison
equal
deleted
inserted
replaced
| 64132:2b32312dcab1 | 64133:686b18bffb86 |
|---|---|
| 204 tstate = PyThreadState_New(interp); | 204 tstate = PyThreadState_New(interp); |
| 205 if (tstate == NULL) | 205 if (tstate == NULL) |
| 206 Py_FatalError("Py_Initialize: can't make first thread"); | 206 Py_FatalError("Py_Initialize: can't make first thread"); |
| 207 (void) PyThreadState_Swap(tstate); | 207 (void) PyThreadState_Swap(tstate); |
| 208 | 208 |
| 209 /* auto-thread-state API, if available */ | |
| 210 #ifdef WITH_THREAD | |
| 211 _PyGILState_Init(interp, tstate); | |
| 212 #endif /* WITH_THREAD */ | |
| 213 | |
| 209 _Py_ReadyTypes(); | 214 _Py_ReadyTypes(); |
| 210 | 215 |
| 211 if (!_PyFrame_Init()) | 216 if (!_PyFrame_Init()) |
| 212 Py_FatalError("Py_Initialize: can't init frames"); | 217 Py_FatalError("Py_Initialize: can't init frames"); |
| 213 | 218 |
| 285 | 290 |
| 286 initmain(); /* Module __main__ */ | 291 initmain(); /* Module __main__ */ |
| 287 if (initstdio() < 0) | 292 if (initstdio() < 0) |
| 288 Py_FatalError( | 293 Py_FatalError( |
| 289 "Py_Initialize: can't initialize sys standard streams"); | 294 "Py_Initialize: can't initialize sys standard streams"); |
| 290 | |
| 291 /* auto-thread-state API, if available */ | |
| 292 #ifdef WITH_THREAD | |
| 293 _PyGILState_Init(interp, tstate); | |
| 294 #endif /* WITH_THREAD */ | |
| 295 | 295 |
| 296 if (!Py_NoSiteFlag) | 296 if (!Py_NoSiteFlag) |
| 297 initsite(); /* Module site */ | 297 initsite(); /* Module site */ |
| 298 } | 298 } |
| 299 | 299 |
