Skip to content

Commit f573fa2

Browse files
committed
fix TSAN
1 parent 17fe79c commit f573fa2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Include/internal/pycore_cell.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ PyCell_SwapTakeRef(PyCellObject *cell, PyObject *value)
1919
{
2020
PyObject *old_value;
2121
Py_BEGIN_CRITICAL_SECTION(cell);
22-
old_value = cell->ob_ref;
23-
cell->ob_ref = value;
22+
FT_ATOMIC_STORE_PTR_RELAXED(old_value, cell->ob_ref);
23+
FT_ATOMIC_STORE_PTR_RELAXED(cell->ob_ref, value);
2424
Py_END_CRITICAL_SECTION();
2525
return old_value;
2626
}

0 commit comments

Comments
 (0)