Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Nov 26, 2025

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 bc9e63d)

Co-authored-by: Alper [email protected]

…ing (pythongh-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.
(cherry picked from commit bc9e63d)

Co-authored-by: Alper <[email protected]>
@colesbury colesbury enabled auto-merge (squash) November 26, 2025 20:41
@colesbury colesbury merged commit f47e928 into python:3.14 Nov 26, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants