Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Improve comments
  • Loading branch information
yoney committed Oct 22, 2025
commit 37ac4ce442fe622dd41410dabd272cec7026d3af
6 changes: 3 additions & 3 deletions Objects/setobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -2774,9 +2774,9 @@ int
PySet_Add(PyObject *anyset, PyObject *key)
{
if (_PyObject_IsUniquelyReferenced(anyset) && PyAnySet_Check(anyset)) {
// In free-threading, if the set or frozenset is uniquely referenced,
// no critical section is needed since only the owner thread is
// populating it.
// We can only change frozensets if they are uniquely referenced,
// and we can avoid locking sets even in free-threaded build if they
// are uniquely referenced.
return set_add_key((PySetObject *)anyset, key);
Comment thread
yoney marked this conversation as resolved.
Outdated
}

Expand Down
Loading