[Python-checkins] r87742 - python/branches/release27-maint/Lib/threading.py

gregory.p.smith python-checkins at python.org
Tue Jan 4 19:43:54 CET 2011


Author: gregory.p.smith
Date: Tue Jan  4 19:43:54 2011
New Revision: 87742

Log:
backport fix from r87741 related to the issue6643 fix in r87727.


Modified:
   python/branches/release27-maint/Lib/threading.py

Modified: python/branches/release27-maint/Lib/threading.py
==============================================================================
--- python/branches/release27-maint/Lib/threading.py	(original)
+++ python/branches/release27-maint/Lib/threading.py	Tue Jan  4 19:43:54 2011
@@ -456,7 +456,8 @@
     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 @@
                 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.


More information about the Python-checkins mailing list