mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +00:00
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).
This commit is contained in:
parent
68530ac3c0
commit
96c886ce96
2 changed files with 151 additions and 4 deletions
|
@ -1064,6 +1064,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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue