summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-06-18 13:57:23 (GMT)
committerGitHub <noreply@github.com>2024-06-18 13:57:23 (GMT)
commite8752d7b80775ec2a348cd4bf38cbe26a4a07615 (patch)
treeaf381ff07ef5c47aa18731fb03d5eb88452a3189 /Misc/NEWS.d
parent360f14a493d8461d42dc646be40b4b6fb20db57a (diff)
downloadcpython-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 'Misc/NEWS.d')
-rw-r--r--Misc/NEWS.d/next/C API/2024-05-08-21-57-50.gh-issue-118789.Ni4UQx.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/C API/2024-05-08-21-57-50.gh-issue-118789.Ni4UQx.rst b/Misc/NEWS.d/next/C API/2024-05-08-21-57-50.gh-issue-118789.Ni4UQx.rst
new file mode 100644
index 0000000..32a9ec6
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2024-05-08-21-57-50.gh-issue-118789.Ni4UQx.rst
@@ -0,0 +1,2 @@
+Add :c:func:`PyUnstable_Object_ClearWeakRefsNoCallbacks`, which clears
+weakrefs without calling their callbacks.