mirror of
https://github.com/python/cpython.git
synced 2026-08-01 09:31:29 +08:00
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. (cherry picked from commit bc9e63dd9d2931771415cca1b0ed774471d523c0) Co-authored-by: Alper <alperyoney@fb.com>