]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-127266: avoid data races when updating type slots (gh-131174)
authorNeil Schemenauer <nas-github@arctrix.com>
Mon, 28 Apr 2025 20:28:44 +0000 (13:28 -0700)
committerGitHub <noreply@github.com>
Mon, 28 Apr 2025 20:28:44 +0000 (20:28 +0000)
commite414a2d81c3e15553516979e146d9f258fb47b2e
treea3235722193c596e4188373416afb4412cdd6045
parent22f0730d40c9534672f745f35cf876ad63d450bb
gh-127266: avoid data races when updating type slots (gh-131174)

In the free-threaded build, avoid data races caused by updating type slots
or type flags after the type was initially created.  For those (typically
rare) cases, use the stop-the-world mechanism.  Remove the use of atomics
when reading or writing type flags.  The use of atomics is not sufficient to
avoid races (since flags are sometimes read without a lock and without
atomics) and are no longer required.
Include/internal/pycore_interp_structs.h
Include/internal/pycore_object.h
Include/internal/pycore_typeobject.h
Include/object.h
Include/refcount.h
Lib/test/test_opcache.py
Misc/NEWS.d/next/Core_and_Builtins/2025-03-14-13-08-20.gh-issue-127266._tyfBp.rst [new file with mode: 0644]
Objects/typeobject.c
Python/ceval.c
Tools/tsan/suppressions_free_threading.txt