Kaydet (Commit) c8762028 authored tarafından Gregory P. Smith's avatar Gregory P. Smith

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

üst 2b79a814
...@@ -456,7 +456,8 @@ class Thread(_Verbose): ...@@ -456,7 +456,8 @@ class Thread(_Verbose):
def _reset_internal_locks(self): def _reset_internal_locks(self):
# private! Called by _after_fork() to reset our internal locks as # private! Called by _after_fork() to reset our internal locks as
# they may be in an invalid state leading to a deadlock or crash. # 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() self.__started._reset_internal_locks()
@property @property
...@@ -884,7 +885,8 @@ def _after_fork(): ...@@ -884,7 +885,8 @@ def _after_fork():
thread._Thread__ident = ident thread._Thread__ident = ident
# Any condition variables hanging off of the active thread may # Any condition variables hanging off of the active thread may
# be in an invalid state, so we reinitialize them. # 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 new_active[ident] = thread
else: else:
# All the others are already stopped. # All the others are already stopped.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment