[3.14] gh-137400: Fix thread-safety issues when profiling all threads (gh-137518) (gh-137730)
There were a few thread-safety issues when profiling or tracing all threads via PyEval_SetProfileAllThreads or PyEval_SetTraceAllThreads: * The loop over thread states could crash if a thread exits concurrently (in both the free threading and default build) * The modification of `c_profilefunc` and `c_tracefunc` wasn't thread-safe on the free threading build. (cherry picked from commit a10152f8fd0f4b291e53d646cffe22fbeec73e1e) Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
S
Sam Gross committed
fb699effbfd9b34a1b2f3ee10338f1f4279509bb
Parent: c1cb785
Committed by GitHub <noreply@github.com>
on 10/7/2025, 5:45:23 PM