]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-132917: Fix data race detected by tsan (#133508)
authorT. Wouters <thomas@python.org>
Tue, 6 May 2025 11:23:10 +0000 (13:23 +0200)
committerGitHub <noreply@github.com>
Tue, 6 May 2025 11:23:10 +0000 (11:23 +0000)
commit53e6d76aa30eb760fb8ff788815f22a0e6c101cd
treec770e46f0a2064c9a3874c791fa419a4f5d436df
parent296cd128bf433b8d3b8d9387d7a8ca2de430fbad
gh-132917: Fix data race detected by tsan (#133508)

Fix data race detected by tsan
(https://github.com/python/cpython/actions/runs/14857021107/job/41712717208?pr=133502):
young.count can be modified by other threads even while the gcstate is
locked.

This is the simplest fix to (potentially) unblock beta 1, although this
particular code path seems like it could just be an atomic swap followed by
an atomic add, without having the lock at all.
Python/gc_free_threading.c