diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2011-01-03 21:06:12 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2011-01-03 21:06:12 (GMT) |
commit | 96c886ce967cb62cedca2e482616f551e809b777 (patch) | |
tree | d06a39d65999d2bc62b644ec75e788564d118bce /Lib/threading.py | |
parent | 68530ac3c0ef5b84aa303ce81cbdc4c07c4349ef (diff) | |
download | cpython-96c886ce967cb62cedca2e482616f551e809b777.zip cpython-96c886ce967cb62cedca2e482616f551e809b777.tar.gz cpython-96c886ce967cb62cedca2e482616f551e809b777.tar.bz2 |
issue6643 - Two locks held within the threading module on each thread instance
needed to be reinitialized after fork(). Adds tests to confirm that they are
and that a potential deadlock and crasher bug are fixed (platform dependant).
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index 01c27b8..b586bb0 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -1064,6 +1064,10 @@ def _after_fork(): # its new value since it can have changed. ident = _get_ident() thread._ident = ident + # Any condition variables hanging off of the active thread may + # be in an invalid state, so we reinitialize them. + thread._block.__init__() + thread._started._cond.__init__() new_active[ident] = thread else: # All the others are already stopped. |