mirror of
https://github.com/python/cpython.git
synced 2026-01-08 00:12:42 +00:00
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.
This commit is contained in:
parent
dc7a2b6522
commit
3926842117
3 changed files with 86 additions and 28 deletions
|
|
@ -0,0 +1,4 @@
|
|||
Fix a crash in the free threading build when :c:func:`PyCode_GetCode`,
|
||||
:c:func:`PyCode_GetVarnames`, :c:func:`PyCode_GetCellvars`, or
|
||||
:c:func:`PyCode_GetFreevars` were called from multiple threads at the same
|
||||
time.
|
||||
Loading…
Add table
Add a link
Reference in a new issue