Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Ensure that :c:func:`PyRefTracer_SetTracer` sync with all existing threads when called
to avoid races in the free threaded build. Patch by Pablo Galindo
2 changes: 2 additions & 0 deletions Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -3286,8 +3286,10 @@ _Py_SetRefcnt(PyObject *ob, Py_ssize_t refcnt)

int PyRefTracer_SetTracer(PyRefTracer tracer, void *data) {
_Py_AssertHoldsTstate();
_PyEval_StopTheWorldAll(&_PyRuntime);
_PyRuntime.ref_tracer.tracer_func = tracer;
_PyRuntime.ref_tracer.tracer_data = data;
_PyEval_StartTheWorldAll(&_PyRuntime);
return 0;
}

Expand Down
Loading