]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-108724: Fix _PySemaphore_Wait call during thread deletion (#116483)
authorSam Gross <colesbury@gmail.com>
Fri, 8 Mar 2024 20:26:36 +0000 (15:26 -0500)
committerGitHub <noreply@github.com>
Fri, 8 Mar 2024 20:26:36 +0000 (15:26 -0500)
commit3cdfdc07a9dd39bcd6855b8c104584f9c34624f2
tree49ef235f2dc7b40cc713dffdc5f9391effa4e0b5
parent601f3a7b3391e9d219a8ec44a6c56d00ce584d2a
gh-108724: Fix _PySemaphore_Wait call during thread deletion (#116483)

In general, when `_PyThreadState_GET()` is non-NULL then the current
thread is "attached", but there is a small window during
`PyThreadState_DeleteCurrent()` where that's not true:
tstate_delete_common() is called when the thread is detached, but before
current_fast_clear().

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Python/parking_lot.c