]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-120321: Make gi_yieldfrom thread-safe in free-threading build (#144292)
authorSam Gross <colesbury@gmail.com>
Fri, 30 Jan 2026 17:20:27 +0000 (12:20 -0500)
committerGitHub <noreply@github.com>
Fri, 30 Jan 2026 17:20:27 +0000 (12:20 -0500)
commita01694dacd8e8bbbd019e8b87dbc7bc7173cb7f1
treea026db0562c786ac6833ef32b544862e3953239e
parenta7048327ed7c6bb83c8c41d50f6d8c5470b6ad71
gh-120321: Make gi_yieldfrom thread-safe in free-threading build (#144292)

Add a FRAME_SUSPENDED_YIELD_FROM_LOCKED state that acts as a brief
lock, preventing other threads from transitioning the frame state
while gen_getyieldfrom reads the yield-from object off the stack.
Include/internal/pycore_frame.h
Include/internal/pycore_lock.h
Lib/test/support/threading_helper.py
Lib/test/test_free_threading/test_generators.py
Misc/NEWS.d/next/Core_and_Builtins/2026-01-27-17-49-43.gh-issue-120321.Vo7c9T.rst [new file with mode: 0644]
Objects/genobject.c
Python/ceval.c
Python/ceval_macros.h
Python/lock.c