gh-112075: Use atomic exchange in Py_SETREF so updating dict pointers doesn't race by DinoV · Pull Request #116620 · python/cpython

mathmodule.c `Py_SETREF(total, new_total);`
64: local

stringio.c `Py_SETREF(decoded, translated);`
104: local

bytesobject.c `Py_SETREF(bytes, bytes_subtype_new(type, bytes));`
133: local

floatobject.c `Py_SETREF(result, PyObject_CallOneArg((PyObject *)type, result));`
147: local

funcobject.c: `Py_SETREF(op->func_qualname, &_Py_STR(empty));`
153: shared, but safe (in tp_clear)

longobject.c `Py_SETREF(a, n)`
164: local

_warnings.c: `Py_SETREF(st->once_registry, registry)`
222: shared (unsafe)

_warnings.c: `Py_SETREF(st->filters, warnings_filters)`
224: shared (unsafe)

context.c `Py_SETREF(ctx->ctx_vars, new_vars);`
241: thread-local

import.c: `Py_SETREF(package, substr)`
255: local