Make queue.SimpleQueue thread-safe in `--disable-gil` builds

Feature or enhancement

Proposal:

Instances of queue.SimpleQueue have mutable state that is not safe to mutate without the GIL. The previous implementation (in 3.12) was colesbury/nogil-3.12@7e60a01aee.

@colesbury - You mentioned in chat that porting the 3.12 approach wouldn't be straightforward. Can you say more?

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs