]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-136870: fix data race in `PyThreadState_Clear` on `sys_tracing_threads...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 21 Jul 2025 21:01:14 +0000 (23:01 +0200)
committerGitHub <noreply@github.com>
Mon, 21 Jul 2025 21:01:14 +0000 (21:01 +0000)
commit718fc5b1393d9ce52fc0353fb361818e865e3e45
tree0fa767ed6741c1a270e4b1f64bff8c404c9c7527
parent893707c53852150e65068fcf80ac5469bde0c0ee
[3.14] gh-136870: fix data race in `PyThreadState_Clear` on `sys_tracing_threads` (GH-136951) (#136953)

gh-136870: fix data race in `PyThreadState_Clear` on `sys_tracing_threads` (GH-136951)

In free-threading, multiple threads can be cleared concurrently as such the modifications on `sys_tracing_threads` should be done while holding the profile lock, otherwise it can race with other threads setting up profiling.
(cherry picked from commit f183996eb77fd2d5662c62667298c292c943ebf5)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Python/pystate.c