summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-06-13 01:30:17 +0200
committerGitHub <noreply@github.com>2019-06-13 01:30:17 +0200
commit468e5fec8a2f534f1685d59da3ca4fad425c38dd (patch)
treeab031e145d86984c0a6236053e8768207e3b2fb2 /Python/pythonrun.c
parentb4c7defe58695a6670a8fdeaef67a638bbb47e42 (diff)
downloadcpython-git-468e5fec8a2f534f1685d59da3ca4fad425c38dd.tar.gz
bpo-36402: Fix threading._shutdown() race condition (GH-13948)
Fix a race condition at Python shutdown when waiting for threads. Wait until the Python thread state of all non-daemon threads get deleted (join all non-daemon threads), rather than just wait until Python threads complete. * Add threading._shutdown_locks: set of Thread._tstate_lock locks of non-daemon threads used by _shutdown() to wait until all Python thread states get deleted. See Thread._set_tstate_lock(). * Add also threading._shutdown_locks_lock to protect access to threading._shutdown_locks. * Add test_finalization_shutdown() test.
Diffstat (limited to 'Python/pythonrun.c')
0 files changed, 0 insertions, 0 deletions