]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-37788: Fix reference leak when Thread is never joined (GH-26103)
authorAntoine Pitrou <antoine@python.org>
Fri, 14 May 2021 19:37:20 +0000 (21:37 +0200)
committerGitHub <noreply@github.com>
Fri, 14 May 2021 19:37:20 +0000 (12:37 -0700)
commitc10c2ec7a0e06975e8010c56c9c3270f8ea322ec
tree7fa4d274bd1bd9d09bff60b50b59d25a2ac28b92
parent07797121cc290ede0b3d3cf02068f3d993cddd15
bpo-37788: Fix reference leak when Thread is never joined (GH-26103)

When a Thread is not joined after it has stopped, its lock may remain in the _shutdown_locks set until interpreter shutdown.  If many threads are created this way, the _shutdown_locks set could therefore grow endlessly.  To avoid such a situation, purge expired locks each time a new one is added or removed.
Lib/test/test_threading.py
Lib/threading.py
Misc/NEWS.d/next/Library/2021-05-13-19-07-28.bpo-37788.adeFcf.rst [new file with mode: 0644]