]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-117657: Use an atomic store to set type flags. (gh-127588)
authorNeil Schemenauer <nas-github@arctrix.com>
Wed, 26 Feb 2025 05:24:20 +0000 (21:24 -0800)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2025 05:24:20 +0000 (21:24 -0800)
commitbaae9cb159e240ee9474ce7c02f88c233390777a
tree032c29ce40b8c393c2b4d5a42230a5dcfc1925af
parent0ef4ffeefd1737c18dc9326133c7894d58108c2e
gh-117657: Use an atomic store to set type flags. (gh-127588)

The `PyType_HasFeature()` function reads the flags with a relaxed atomic
load and without holding the type lock.  To avoid data races, use atomic
stores if `PyType_Ready()` has already been called.
Objects/typeobject.c