summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-09-06 19:07:08 (GMT)
committerGitHub <noreply@github.com>2024-09-06 19:07:08 (GMT)
commit0c080d7c77d826c1afab7bd6b73f61e714cffcb7 (patch)
tree659e61d4fd1830f4dd7e2c1daf94bd9df3e330ef /Lib
parent8a46a2ec5032c5eb1bc3c6bb0fc2422ac9b2cc53 (diff)
downloadcpython-0c080d7c77d826c1afab7bd6b73f61e714cffcb7.zip
cpython-0c080d7c77d826c1afab7bd6b73f61e714cffcb7.tar.gz
cpython-0c080d7c77d826c1afab7bd6b73f61e714cffcb7.tar.bz2
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.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_readline.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py
index 7d07906..50e77cb 100644
--- a/Lib/test/test_readline.py
+++ b/Lib/test/test_readline.py
@@ -7,7 +7,7 @@ import sys
import tempfile
import textwrap
import unittest
-from test.support import requires_gil_enabled, verbose
+from test.support import verbose
from test.support.import_helper import import_module
from test.support.os_helper import unlink, temp_dir, TESTFN
from test.support.pty_helper import run_pty
@@ -351,7 +351,6 @@ readline.write_history_file(history_file)
self.assertEqual(lines[-1].strip(), b"last input")
@requires_working_threading()
- @requires_gil_enabled()
def test_gh123321_threadsafe(self):
"""gh-123321: readline should be thread-safe and not crash"""
script = textwrap.dedent(r"""