gh-116738: Fix thread-safety issue in re module for free threading (gh-141923)
Added atomic operations to `scanner_begin()` and `scanner_end()` to prevent race conditions on the `executing` flag in free-threaded builds. Also added tests for concurrent usage of the `re` module. Without the atomic operations, `test_scanner_concurrent_access()` triggers `assert(self->executing)` failures, or a thread sanitizer run emits errors.
A
Alper committed
bc9e63dd9d2931771415cca1b0ed774471d523c0
Parent: 9ac1428
Committed by GitHub <noreply@github.com>
on 11/26/2025, 8:40:45 PM