Skip to content

Commit 37ac4ce

Browse files
committed
Improve comments
1 parent d1aaf9a commit 37ac4ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Objects/setobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2774,9 +2774,9 @@ int
27742774
PySet_Add(PyObject *anyset, PyObject *key)
27752775
{
27762776
if (_PyObject_IsUniquelyReferenced(anyset) && PyAnySet_Check(anyset)) {
2777-
// In free-threading, if the set or frozenset is uniquely referenced,
2778-
// no critical section is needed since only the owner thread is
2779-
// populating it.
2777+
// We can only change frozensets if they are uniquely referenced,
2778+
// and we can avoid locking sets even in free-threaded build if they
2779+
// are uniquely referenced.
27802780
return set_add_key((PySetObject *)anyset, key);
27812781
}
27822782

0 commit comments

Comments
 (0)