gh-112050: Make collections.deque thread-safe in free-threaded builds (#113830)

Use critical sections to make deque methods that operate on mutable 
state thread-safe when the GIL is disabled. This is mostly accomplished
by using the @critical_section Argument Clinic directive, though there
are a few places where this was not possible and critical sections had
to be manually acquired/released.
This commit is contained in:
mpage 2024-02-15 00:22:47 -08:00 committed by GitHub
parent 474204765b
commit dc978f6ab6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 338 additions and 61 deletions

View file

@ -0,0 +1 @@
Make methods on :class:`collections.deque` thread-safe when the GIL is disabled.