Issue #10517: After fork(), reinitialize the TLS used by the PyGILState_*

APIs, to avoid a crash with the pthread implementation in RHEL 5.  Patch
by Charles-François Natali.
This commit is contained in:
Antoine Pitrou 2011-04-27 19:28:05 +02:00
parent 43ae619925
commit 0c759febb6
4 changed files with 23 additions and 0 deletions

View file

@ -991,6 +991,7 @@ void
PyOS_AfterFork(void)
{
#ifdef WITH_THREAD
_PyGILState_Reinit();
PyEval_ReInitThreads();
main_thread = PyThread_get_thread_ident();
main_pid = getpid();