diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2011-01-04 00:51:50 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2011-01-04 00:51:50 (GMT) |
commit | 4b129d23f66f88fb91aa95d163ef55a47095ae0d (patch) | |
tree | be89afd4f61b4dd0ca4237db17549891699ead7b /Lib/threading.py | |
parent | c3a4787ccbc0f91827120c0a519747305379e4d4 (diff) | |
download | cpython-4b129d23f66f88fb91aa95d163ef55a47095ae0d.zip cpython-4b129d23f66f88fb91aa95d163ef55a47095ae0d.tar.gz cpython-4b129d23f66f88fb91aa95d163ef55a47095ae0d.tar.bz2 |
Merged revisions 87710 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r87710 | gregory.p.smith | 2011-01-03 13:06:12 -0800 (Mon, 03 Jan 2011) | 4 lines
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 24808d4..76c729b 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -856,6 +856,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. |