gh-114271: Make `_thread.lock` thread-safe in free-threaded builds (#116433)
Previously, the `locked` field was set after releasing the lock. This reverses the order so that the `locked` field is set while the lock is still held. There is still one thread-safety issue where `locked` is checked prior to releasing the lock, however, in practice that will only be an issue when unlocking the lock is contended, which should be rare.
M
mpage committed
c62144a02cfae412a9deb4059fae141693a6edc9
Parent: ce0ae1d
Committed by GitHub <noreply@github.com>
on 3/6/2024, 8:46:36 PM