From a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Thu, 7 Sep 2017 18:56:24 +0200 Subject: bpo-31370: Remove support for threads-less builds (#3385) * Remove Setup.config * Always define WITH_THREAD for compatibility. --- Parser/myreadline.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'Parser/myreadline.c') diff --git a/Parser/myreadline.c b/Parser/myreadline.c index 9f3c2e343c..1b63f7863f 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -18,10 +18,8 @@ PyThreadState* _PyOS_ReadlineTState; -#ifdef WITH_THREAD #include "pythread.h" static PyThread_type_lock _PyOS_ReadlineLock = NULL; -#endif int (*PyOS_InputHook)(void) = NULL; @@ -77,13 +75,9 @@ my_fgets(char *buf, int len, FILE *fp) #ifdef EINTR if (err == EINTR) { int s; -#ifdef WITH_THREAD PyEval_RestoreThread(_PyOS_ReadlineTState); -#endif s = PyErr_CheckSignals(); -#ifdef WITH_THREAD PyEval_SaveThread(); -#endif if (s < 0) return 1; /* try again */ @@ -133,13 +127,9 @@ _PyOS_WindowsConsoleReadline(HANDLE hStdIn) if (WaitForSingleObjectEx(hInterruptEvent, 100, FALSE) == WAIT_OBJECT_0) { ResetEvent(hInterruptEvent); -#ifdef WITH_THREAD PyEval_RestoreThread(_PyOS_ReadlineTState); -#endif s = PyErr_CheckSignals(); -#ifdef WITH_THREAD PyEval_SaveThread(); -#endif if (s < 0) goto exit; } @@ -178,13 +168,9 @@ exit: PyMem_RawFree(wbuf); if (err) { -#ifdef WITH_THREAD PyEval_RestoreThread(_PyOS_ReadlineTState); -#endif PyErr_SetFromWindowsErr(err); -#ifdef WITH_THREAD PyEval_SaveThread(); -#endif } return buf; @@ -319,17 +305,13 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt) PyOS_ReadlineFunctionPointer = PyOS_StdioReadline; } -#ifdef WITH_THREAD if (_PyOS_ReadlineLock == NULL) { _PyOS_ReadlineLock = PyThread_allocate_lock(); } -#endif _PyOS_ReadlineTState = PyThreadState_GET(); Py_BEGIN_ALLOW_THREADS -#ifdef WITH_THREAD PyThread_acquire_lock(_PyOS_ReadlineLock, 1); -#endif /* This is needed to handle the unlikely case that the * interpreter is in interactive mode *and* stdin/out are not @@ -343,9 +325,7 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt) prompt); Py_END_ALLOW_THREADS -#ifdef WITH_THREAD PyThread_release_lock(_PyOS_ReadlineLock); -#endif _PyOS_ReadlineTState = NULL; -- cgit v1.2.3