diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2011-01-04 18:43:54 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2011-01-04 18:43:54 (GMT) |
commit | c87620286d0b4d7c24cd617ceb8ffd32994f0feb (patch) | |
tree | 5830108c75f05105b44d87bdad4e83d8437ed180 /Lib/threading.py | |
parent | 2b79a8146155579bf2ea8acdd4237bc58554dbb8 (diff) | |
download | cpython-c87620286d0b4d7c24cd617ceb8ffd32994f0feb.zip cpython-c87620286d0b4d7c24cd617ceb8ffd32994f0feb.tar.gz cpython-c87620286d0b4d7c24cd617ceb8ffd32994f0feb.tar.bz2 |
backport fix from r87741 related to the issue6643 fix in r87727.
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index b05597d..6a06feb 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -456,7 +456,8 @@ class Thread(_Verbose): def _reset_internal_locks(self): # private! Called by _after_fork() to reset our internal locks as # they may be in an invalid state leading to a deadlock or crash. - self.__block.__init__() + if hasattr(self, '_Thread__block'): # DummyThread deletes self.__block + self.__block.__init__() self.__started._reset_internal_locks() @property @@ -884,7 +885,8 @@ def _after_fork(): thread._Thread__ident = ident # Any condition variables hanging off of the active thread may # be in an invalid state, so we reinitialize them. - thread._reset_internal_locks() + if hasattr(thread, '_reset_internal_locks'): + thread._reset_internal_locks() new_active[ident] = thread else: # All the others are already stopped. |