gh-116738: Use PyMutex for bz2 module (gh-140555)
The methods are already wrapped with a lock, which makes them thread-safe in free-threaded build. This replaces `PyThread_acquire_lock` with `PyMutex` and removes some macros and allocation handling code. Also add a test for free-threading to ensure we aren't getting data races and that the locking is working.
A
Alper committed
9479a62a51e6fbcb3372f5ac07b3ab861e7d17e3
Parent: e8b5cb8
Committed by GitHub <noreply@github.com>
on 10/27/2025, 1:52:30 PM