mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
bpo-18966: non-daemonic threads created by a multiprocessing.Process should be joined on exit (#3111)
* bpo-18966: non-daemonic threads created by a multiprocessing.Process should be joined on exit * Add NEWS blurb
This commit is contained in:
parent
17657bb945
commit
ee84a60858
4 changed files with 33 additions and 0 deletions
|
@ -1284,6 +1284,9 @@ def _shutdown():
|
|||
# the main thread's tstate_lock - that won't happen until the interpreter
|
||||
# is nearly dead. So we release it here. Note that just calling _stop()
|
||||
# isn't enough: other threads may already be waiting on _tstate_lock.
|
||||
if _main_thread._is_stopped:
|
||||
# _shutdown() was already called
|
||||
return
|
||||
tlock = _main_thread._tstate_lock
|
||||
# The main thread isn't finished yet, so its thread state lock can't have
|
||||
# been released.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue