diff options
author | Sam Gross <colesbury@gmail.com> | 2024-06-18 13:57:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-18 13:57:23 (GMT) |
commit | e8752d7b80775ec2a348cd4bf38cbe26a4a07615 (patch) | |
tree | af381ff07ef5c47aa18731fb03d5eb88452a3189 /Python/legacy_tracing.c | |
parent | 360f14a493d8461d42dc646be40b4b6fb20db57a (diff) | |
download | cpython-e8752d7b80775ec2a348cd4bf38cbe26a4a07615.zip cpython-e8752d7b80775ec2a348cd4bf38cbe26a4a07615.tar.gz cpython-e8752d7b80775ec2a348cd4bf38cbe26a4a07615.tar.bz2 |
gh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (#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.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Diffstat (limited to 'Python/legacy_tracing.c')
0 files changed, 0 insertions, 0 deletions