]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 27 Sep 2021 12:49:30 +0000 (05:49 -0700)
committerGitHub <noreply@github.com>
Mon, 27 Sep 2021 12:49:30 +0000 (05:49 -0700)
commit1ecb641b887af2feb026a266e2fceedee0815ca8
treef67b93bf714b056efe10c1ca819092fd568a7657
parent08e387ab82331230d7f6608e949723d8a8e09229
bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532)

Fix a race condition in the Thread.join() method of the threading
module. If the function is interrupted by a signal and the signal
handler raises an exception, make sure that the thread remains in a
consistent state to prevent a deadlock.
(cherry picked from commit a22be4943c119fecf5433d999227ff78fc2e5741)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/threading.py
Misc/NEWS.d/next/Library/2021-09-23-22-17-26.bpo-45274.gPpa4E.rst [new file with mode: 0644]