]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-113743: Make the MRO cache thread-safe in free-threaded builds (#113930)
authorDino Viehland <dinoviehland@meta.com>
Thu, 15 Feb 2024 18:54:57 +0000 (10:54 -0800)
committerGitHub <noreply@github.com>
Thu, 15 Feb 2024 18:54:57 +0000 (10:54 -0800)
commitae460d450ab854ca66d509ef6971cfe1b6312405
tree25cbb65be2f0f0779ff37174751026e8fd262dde
parente74fa294c9b0c67bfcbefdda5a069f0a7648f524
gh-113743: Make the MRO cache thread-safe in free-threaded builds (#113930)

Makes _PyType_Lookup thread safe, including:
    Thread safety of the underlying cache.
    Make mutation of mro and type members thread safe
    Also _PyType_GetMRO and _PyType_GetBases are currently returning borrowed references which aren't safe.
Include/cpython/pyatomic.h
Include/cpython/pyatomic_gcc.h
Include/cpython/pyatomic_msc.h
Include/cpython/pyatomic_std.h
Include/internal/pycore_critical_section.h
Include/internal/pycore_lock.h
Include/internal/pycore_typeobject.h
Modules/_abc.c
Objects/typeobject.c
Python/lock.c
Python/pystate.c