[issue874900] threading module can deadlock after fork

Amaury Forgeot d'Arc report at bugs.python.org
Thu Jul 10 01:59:48 CEST 2008

Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

A new patch:
- I replaced "_active_limbo_lock.release()" by

- I replaced the successive deletions in _active by a re-creation with
only the current thread. There is no difference in the result, but I
agree that the intent is more clear.

- yes, the main thread is marked as done when the interpreter exits
(hence the convoluted tests with subprocesses): in Modules/main.c,
WaitForThreadShutdown() calls threading._shutdown().

Also, I hope the tests make more sense now.

Added file: http://bugs.python.org/file10872/fork-and-thread4.patch

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list