]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-123321: Make Parser/myreadline.c locking safe in free-threaded build (#123690)
authorSam Gross <colesbury@gmail.com>
Fri, 6 Sep 2024 19:07:08 +0000 (15:07 -0400)
committerGitHub <noreply@github.com>
Fri, 6 Sep 2024 19:07:08 +0000 (15:07 -0400)
commit0c080d7c77d826c1afab7bd6b73f61e714cffcb7
tree659e61d4fd1830f4dd7e2c1daf94bd9df3e330ef
parent8a46a2ec5032c5eb1bc3c6bb0fc2422ac9b2cc53
gh-123321: Make Parser/myreadline.c locking safe in free-threaded build (#123690)

Use a `PyMutex` to avoid the race in mutex initialization. Use relaxed
atomics to avoid the data race on reading `_PyOS_ReadlineTState` when
checking for re-entrant calls.
Lib/test/test_readline.py
Parser/myreadline.c