Skip to content

Commit

Permalink
self-review
Browse files Browse the repository at this point in the history
  • Loading branch information
dpdani committed May 21, 2024
1 parent 7aa0396 commit 419929d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Python/structmember.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,14 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v)
break;
case _Py_T_OBJECT:
case Py_T_OBJECT_EX:
#ifndef Py_GIL_DISABLED
oldv = *(PyObject **)addr;
*(PyObject **)addr = Py_XNewRef(v);
#else
_PyObject_SetMaybeWeakref(v); // without setting _Py_REF_MAYBE_WEAKREF,
// we may get an infinite loop in PyMember_GetOne
oldv = FT_ATOMIC_EXCHANGE_PTR(addr, Py_XNewRef(v));
#endif
Py_XDECREF(oldv);
break;
case Py_T_CHAR: {
Expand Down
2 changes: 1 addition & 1 deletion Tools/tsan/suppressions_free_threading.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ race:_PyParkingLot_Park
race_top:_add_to_weak_set
race_top:_in_weak_set
race_top:_mi_heap_delayed_free_partial
#race_top:_PyEval_EvalFrameDefault
race_top:_PyEval_EvalFrameDefault
race_top:_PyImport_AcquireLock
race_top:_PyImport_ReleaseLock
# https://gist.github.com/mpage/0a24eb2dd458441ededb498e9b0e5de8
Expand Down

0 comments on commit 419929d

Please sign in to comment.