◐ Shell
clean mode source ↗

gh-120321: Make gi_yieldfrom thread-safe in free-threading build by colesbury · Pull Request #144292 · python/cpython

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.

@colesbury

@colesbury

thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request

Feb 15, 2026
python#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.