This commit is contained in:
Charles-François Natali 2012-02-02 20:38:10 +01:00
commit 3f32fc87ad
2 changed files with 26 additions and 1 deletions

View file

@ -1403,12 +1403,14 @@ void
PyOS_AfterFork(void)
{
#ifdef WITH_THREAD
/* PyThread_ReInitTLS() must be called early, to make sure that the TLS API
* can be called safely. */
PyThread_ReInitTLS();
_PyGILState_Reinit();
PyEval_ReInitThreads();
main_thread = PyThread_get_thread_ident();
main_pid = getpid();
_PyImport_ReInitLock();
PyThread_ReInitTLS();
#endif
}