summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorAntoine Pitrou <pitrou@free.fr>2017-09-07 16:56:24 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-09-07 16:56:24 (GMT)
commita6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 (patch)
tree1c31738009bee903417cea928e705a112aea2392 /Parser
parent1f06a680de465be0c24a78ea3b610053955daa99 (diff)
downloadcpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.zip
cpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.tar.gz
cpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.tar.bz2
bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config * Always define WITH_THREAD for compatibility.
Diffstat (limited to 'Parser')
-rw-r--r--Parser/myreadline.c20
-rw-r--r--Parser/pgenmain.c2
2 files changed, 0 insertions, 22 deletions
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index 9f3c2e3..1b63f78 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;
diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c
index e386248..ce66ebc 100644
--- a/Parser/pgenmain.c
+++ b/Parser/pgenmain.c
@@ -37,11 +37,9 @@ Py_Exit(int sts)
exit(sts);
}
-#ifdef WITH_THREAD
/* Needed by obmalloc.c */
int PyGILState_Check(void)
{ return 1; }
-#endif
void _PyMem_DumpTraceback(int fd, const void *ptr)
{}