]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-119369: Fix deadlock during thread exit in free-threaded build (GH-119528...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 31 May 2024 18:19:38 +0000 (20:19 +0200)
committerGitHub <noreply@github.com>
Fri, 31 May 2024 18:19:38 +0000 (14:19 -0400)
commita7e81fdfc175bd9cf82dfd8f1e1853cb942bf0f0
treefa6ecd452e4f0f4ffc9aea8b0a18e62db618d094
parent5e8396e6841e3aae8cc10117583e596ff294d7e0
[3.13] gh-119369: Fix deadlock during thread exit in free-threaded build (GH-119528) (#119868)

Release the GIL before calling `_Py_qsbr_unregister`.

The deadlock could occur when the GIL was enabled at runtime. The
`_Py_qsbr_unregister` call might block while holding the GIL because the
thread state was not active, but the GIL was still held.
(cherry picked from commit 078b8c8cf2bf68f7484cc4d2e3dd74b6fab55664)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Misc/NEWS.d/next/Core and Builtins/2024-05-24-21-16-52.gh-issue-119369.qBThho.rst [new file with mode: 0644]
Python/pystate.c
Python/qsbr.c