mirror of
https://github.com/python/cpython.git
synced 2025-11-13 23:46:24 +00:00
"#if WITH_THREAD" is incorrect; must be #ifdef instead; WITH_THREAD
isn't always set to an integer value when it's defined.
This commit is contained in:
parent
30ea2f223f
commit
b7e898a0e2
1 changed files with 4 additions and 4 deletions
|
|
@ -22,7 +22,7 @@ extern char* vms__StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
|
||||||
|
|
||||||
PyThreadState* _PyOS_ReadlineTState;
|
PyThreadState* _PyOS_ReadlineTState;
|
||||||
|
|
||||||
#if WITH_THREAD
|
#ifdef WITH_THREAD
|
||||||
#include "pythread.h"
|
#include "pythread.h"
|
||||||
static PyThread_type_lock _PyOS_ReadlineLock = NULL;
|
static PyThread_type_lock _PyOS_ReadlineLock = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -181,7 +181,7 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if WITH_THREAD
|
#ifdef WITH_THREAD
|
||||||
if (_PyOS_ReadlineLock == NULL) {
|
if (_PyOS_ReadlineLock == NULL) {
|
||||||
_PyOS_ReadlineLock = PyThread_allocate_lock();
|
_PyOS_ReadlineLock = PyThread_allocate_lock();
|
||||||
}
|
}
|
||||||
|
|
@ -189,7 +189,7 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
|
||||||
|
|
||||||
_PyOS_ReadlineTState = PyThreadState_GET();
|
_PyOS_ReadlineTState = PyThreadState_GET();
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
#if WITH_THREAD
|
#ifdef WITH_THREAD
|
||||||
PyThread_acquire_lock(_PyOS_ReadlineLock, 1);
|
PyThread_acquire_lock(_PyOS_ReadlineLock, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -205,7 +205,7 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
|
||||||
prompt);
|
prompt);
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
|
|
||||||
#if WITH_THREAD
|
#ifdef WITH_THREAD
|
||||||
PyThread_release_lock(_PyOS_ReadlineLock);
|
PyThread_release_lock(_PyOS_ReadlineLock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue