]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-127020: Make `PyCode_GetCode` thread-safe for free threading (#127043)
authorSam Gross <colesbury@gmail.com>
Thu, 21 Nov 2024 16:00:50 +0000 (16:00 +0000)
committerGitHub <noreply@github.com>
Thu, 21 Nov 2024 16:00:50 +0000 (11:00 -0500)
commit3926842117feffe5d2c9727e1899bea5ae2adb28
treee35c20914dac0a189b0a61736ee3a87ad18a5d09
parentdc7a2b6522ec7af41282bc34f405bee9b306d611
gh-127020: Make `PyCode_GetCode` thread-safe for free threading (#127043)

Some fields in PyCodeObject are lazily initialized. Use atomics and
critical sections to make their initializations and accesses thread-safe.
Lib/test/test_free_threading/test_code.py [new file with mode: 0644]
Misc/NEWS.d/next/Core_and_Builtins/2024-11-19-21-49-58.gh-issue-127020.5vvI17.rst [new file with mode: 0644]
Objects/codeobject.c