]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-127020: Make `PyCode_GetCode` thread-safe for free threading (GH-127043...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 21 Nov 2024 16:27:36 +0000 (17:27 +0100)
committerGitHub <noreply@github.com>
Thu, 21 Nov 2024 16:27:36 +0000 (16:27 +0000)
commitc74331413ea847ff1099f584e5fecbd7f5036f7d
tree4b86990c48de08de0a3a386fcfd9df8444f0aa64
parentc09366b1fed2289530581505834b2b262120a7c7
[3.13] gh-127020: Make `PyCode_GetCode` thread-safe for free threading (GH-127043) (GH-127107)

Some fields in PyCodeObject are lazily initialized. Use atomics and
critical sections to make their initializations and accesses thread-safe.
(cherry picked from commit 3926842117feffe5d2c9727e1899bea5ae2adb28)

Co-authored-by: Sam Gross <colesbury@gmail.com>
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