]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-127521: Mark list as "shared" before resizing if necessary (#127524)
authorSam Gross <colesbury@gmail.com>
Mon, 2 Dec 2024 19:38:26 +0000 (19:38 +0000)
committerGitHub <noreply@github.com>
Mon, 2 Dec 2024 19:38:26 +0000 (14:38 -0500)
commitc7dec02de2ed4baf3cd22ad094350265b52c18af
tree1fd473d97b5e6e38e0b26254d31140884855aa78
parentc4303763dac4494300e299e54c079a4a11931a55
gh-127521: Mark list as "shared" before resizing if necessary (#127524)

In the free threading build, if a non-owning thread resizes a list,
it must use QSBR to free the old list array because there may be a
concurrent access (without a lock) from the owning thread.

To match the pattern in dictobject.c, we just mark the list as "shared"
before resizing if it's from a non-owning thread and not already marked
as shared.
Objects/listobject.c