| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…thonGH-118807) This exposes `PyUnstable_Object_ClearWeakRefsNoCallbacks` as an unstable C-API function to provide a thread-safe mechanism for clearing weakrefs without executing callbacks. Some C-API extensions need to clear weakrefs without calling callbacks, such as after running finalizers like we do in subtype_dealloc. Previously they could use `_PyWeakref_ClearRef` on each weakref, but that's not thread-safe in the free-threaded build. (cherry picked from commit e8752d7) Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
| Back | FazBrowse Home | New Git URL |
This exposes PyUnstable_Object_ClearWeakRefsNoCallbacks as an unstable
C-API function to provide a thread-safe mechanism for clearing weakrefs
without executing callbacks.
Some C-API extensions need to clear weakrefs without calling callbacks,
such as after running finalizers like we do in subtype_dealloc.
Previously they could use _PyWeakref_ClearRef on each weakref, but
that's not thread-safe in the free-threaded build.
(cherry picked from commit e8752d7)
Co-authored-by: Sam Gross colesbury@gmail.com
Co-authored-by: Petr Viktorin encukou@gmail.com
📚 Documentation preview 📚: https://cpython-previews--120695.org.readthedocs.build/