Skip to content
Merged
Changes from all 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
4 changes: 4 additions & 0 deletions Modules/_threadmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,10 @@ local_new(PyTypeObject *type, PyObject *args, PyObject *kw)
return NULL;
}

// gh-128691: Use deferred reference counting for thread-locals to avoid
// contention on the shared object.
_PyObject_SetDeferredRefcount((PyObject *)self);

self->args = Py_XNewRef(args);
self->kw = Py_XNewRef(kw);

Expand Down
Loading