diff options
author | Sam Gross <colesbury@gmail.com> | 2024-12-05 21:07:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-05 21:07:31 (GMT) |
commit | f4f530804b9d8f089eba0f157ec2144c03b13651 (patch) | |
tree | ce40d723b8c991d786924c16dd04dfa96ff8689b /Modules/_tkinter.c | |
parent | 657d0e99aa8754372786120d6ec00c9d9970e775 (diff) | |
download | cpython-f4f530804b9d8f089eba0f157ec2144c03b13651.zip cpython-f4f530804b9d8f089eba0f157ec2144c03b13651.tar.gz cpython-f4f530804b9d8f089eba0f157ec2144c03b13651.tar.bz2 |
gh-127582: Make object resurrection thread-safe for free threading. (GH-127612)
Objects may be temporarily "resurrected" in destructors when calling
finalizers or watcher callbacks. We previously undid the resurrection
by decrementing the reference count using `Py_SET_REFCNT`. This was not
thread-safe because other threads might be accessing the object
(modifying its reference count) if it was exposed by the finalizer,
watcher callback, or temporarily accessed by a racy dictionary or list
access.
This adds internal-only thread-safe functions for temporary object
resurrection during destructors.
Diffstat (limited to 'Modules/_tkinter.c')
0 files changed, 0 insertions, 0 deletions