mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
gh-117323: Make cell thread-safe in free-threaded builds (#117330)
Use critical sections to lock around accesses to cell contents. The critical sections are no-ops in the default (with GIL) build.
This commit is contained in:
parent
397d88db5e
commit
19c1dd60c5
11 changed files with 83 additions and 43 deletions
|
|
@ -520,8 +520,9 @@ def effect_depends_on_oparg_1(op: parser.InstDef) -> bool:
|
|||
def compute_properties(op: parser.InstDef) -> Properties:
|
||||
has_free = (
|
||||
variable_used(op, "PyCell_New")
|
||||
or variable_used(op, "PyCell_GET")
|
||||
or variable_used(op, "PyCell_SET")
|
||||
or variable_used(op, "PyCell_GetRef")
|
||||
or variable_used(op, "PyCell_SetTakeRef")
|
||||
or variable_used(op, "PyCell_SwapTakeRef")
|
||||
)
|
||||
deopts_if = variable_used(op, "DEOPT_IF")
|
||||
exits_if = variable_used(op, "EXIT_IF")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue