mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
backport fix from r87741 related to the issue6643 fix in r87727.
This commit is contained in:
parent
2b79a81461
commit
c87620286d
1 changed files with 4 additions and 2 deletions
|
@ -456,6 +456,7 @@ 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.
|
||||||
|
if hasattr(self, '_Thread__block'): # DummyThread deletes self.__block
|
||||||
self.__block.__init__()
|
self.__block.__init__()
|
||||||
self.__started._reset_internal_locks()
|
self.__started._reset_internal_locks()
|
||||||
|
|
||||||
|
@ -884,6 +885,7 @@ 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.
|
||||||
|
if hasattr(thread, '_reset_internal_locks'):
|
||||||
thread._reset_internal_locks()
|
thread._reset_internal_locks()
|
||||||
new_active[ident] = thread
|
new_active[ident] = thread
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue