]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-127521: Mark list as "shared" before resizing if necessary (GH-127524)...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 3 Dec 2024 00:22:05 +0000 (01:22 +0100)
committerGitHub <noreply@github.com>
Tue, 3 Dec 2024 00:22:05 +0000 (19:22 -0500)
commite546876d83e1cc3f761e1eeca57f8a4533d06d00
tree9a97ce06d140fe621a45cfbffa82f11753acbafb
parenta8536102828ac70000fc6b4c67e0b439ab0ddf98
[3.13] gh-127521: Mark list as "shared" before resizing if necessary (GH-127524) (GH-127533)

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.
(cherry picked from commit c7dec02de2ed4baf3cd22ad094350265b52c18af)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Objects/listobject.c