Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-114271: Make the common usage of
_thread.lock
thread-safe …
…in free-threaded builds 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.
- Loading branch information