]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-123089: Make weakref.WeakSet safe against concurrent mutations while it is being...
authorKumar Aditya <kumaraditya@python.org>
Tue, 27 Aug 2024 13:04:03 +0000 (18:34 +0530)
committerGitHub <noreply@github.com>
Tue, 27 Aug 2024 13:04:03 +0000 (13:04 +0000)
commit03f5abf15a20f6e623282a393bc2a0affac69bb0
tree1512e4add5d1f42b56c3890a9cf88119215c8483
parent6754566a51a5706e8c9da0094b892113311ba20c
gh-123089: Make weakref.WeakSet safe against concurrent mutations while it is being iterated  (#123279)

* Make `weakref.WeakSet` safe against concurrent mutations while it is being iterated.

`_IterationGuard` is no longer used for `WeakSet`, it now relies on copying the underlying set which is an atomic operation while iterating so that it can be modified by other threads.
Lib/_weakrefset.py
Misc/NEWS.d/next/Library/2024-08-27-12-38-42.gh-issue-123089.vA7iFR.rst [new file with mode: 0644]