]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-117657: Fix TSAN race involving import lock (GH-118523) (#120169)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 6 Jun 2024 18:03:01 +0000 (20:03 +0200)
committerGitHub <noreply@github.com>
Thu, 6 Jun 2024 18:03:01 +0000 (18:03 +0000)
commit517733ce3cd7937dc527f1f191582c21cfb9b685
tree64e0f07217be36c2991f65c8d9cd6c02114d5c68
parent015ddfeca5e39a3796ee144d07accb1d5c7e7522
[3.13] gh-117657: Fix TSAN race involving import lock (GH-118523) (#120169)

This adds a `_PyRecursiveMutex` type based on `PyMutex` and uses that
for the import lock. This fixes some data races in the free-threaded
build and generally simplifies the import lock code.
(cherry picked from commit e21057b99967eb5323320e6d1121955e0cd2985e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Include/internal/pycore_import.h
Include/internal/pycore_lock.h
Modules/_testinternalcapi/test_lock.c
Modules/posixmodule.c
Python/import.c
Python/lock.c
Tools/tsan/suppressions_free_threading.txt