Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 15, 2025

The previous Py_REFCNT(x) == 1 checks can have data races in the free
threaded build. _PyObject_IsUniquelyReferenced(x) is a more conservative
check that is safe in the free threaded build and is identical to
Py_REFCNT(x) == 1 in the default GIL-enabled build.
(cherry picked from commit 32c2649)

Co-authored-by: Sergey Miryanov [email protected]

…bjects are uniquely referenced (pythongh-140062)

The previous `Py_REFCNT(x) == 1` checks can have data races in the free
threaded build. `_PyObject_IsUniquelyReferenced(x)` is a more conservative
check that is safe in the free threaded build and is identical to
`Py_REFCNT(x) == 1` in the default GIL-enabled build.
(cherry picked from commit 32c2649)

Co-authored-by: Sergey Miryanov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants