]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-117657: Fix TSAN race in free-threaded GC (GH-119883) (#119903)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 1 Jun 2024 14:26:12 +0000 (16:26 +0200)
committerGitHub <noreply@github.com>
Sat, 1 Jun 2024 14:26:12 +0000 (14:26 +0000)
commit48f3378d6c620e99f17679ee11982a57640d3bb4
tree3da6204474060816bb97e1efb16169d86ec501fc
parenta0559849ac2de604ffa410268be262a8482ad23c
[3.13] gh-117657: Fix TSAN race in free-threaded GC (GH-119883) (#119903)

Only call `gc_restore_tid()` from stop-the-world contexts.
`worklist_pop()` can be called while other threads are running, so use a
relaxed atomic to modify `ob_tid`.
(cherry picked from commit 60593b2052ca275559c11028d50e19f8e5dfee13)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Python/gc_free_threading.c
Tools/tsan/suppressions_free_threading.txt