diff options
| author | Sam Gross <colesbury@gmail.com> | 2024-12-05 23:49:33 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-05 23:49:33 (GMT) |
| commit | 69bb1c6c41c9840e4ae9537ff3e8e6eef718a0a8 (patch) | |
| tree | 75fd841e58796b7cf596f97f478c1c7133679665 /Python/pythonrun.c | |
| parent | 304111e96741ff94c1970fe3f2ab9c804e78ecb8 (diff) | |
| download | cpython-69bb1c6c41c9840e4ae9537ff3e8e6eef718a0a8.zip cpython-69bb1c6c41c9840e4ae9537ff3e8e6eef718a0a8.tar.gz cpython-69bb1c6c41c9840e4ae9537ff3e8e6eef718a0a8.tar.bz2 | |
[3.13] gh-127582: Make object resurrection thread-safe for free threading. (GH-127612) (GH-127659)
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.
(cherry picked from commit f4f530804b9d8f089eba0f157ec2144c03b13651)
Diffstat (limited to 'Python/pythonrun.c')
0 files changed, 0 insertions, 0 deletions
