]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-123321: Make Parser/myreadline.c locking safe in free-threaded build (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 6 Sep 2024 20:55:42 +0000 (22:55 +0200)
committerGitHub <noreply@github.com>
Fri, 6 Sep 2024 20:55:42 +0000 (22:55 +0200)
commit905288824dd6874659bf3e3aa06c6a67e47f0ac3
tree3c5ede90bb6223165509a723ddccb207030ad206
parente68f30ecd2505a3fe25b93e7a62193adb9bcaf79
[3.13] gh-123321: Make Parser/myreadline.c locking safe in free-threaded build (GH-123690) (#123798)

gh-123321: Make Parser/myreadline.c locking safe in free-threaded build (GH-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.
(cherry picked from commit 0c080d7c77d826c1afab7bd6b73f61e714cffcb7)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Lib/test/test_readline.py
Parser/myreadline.c