Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8efa47b

Browse files
committed
We now assume that PyOS_Readline() is called with the interpreter lock
held. It releases the lock around the call to the function pointed to by PyOS_ReadlineFunctionPointer (default PyOS_StdioReadline()).
1 parent 44ee479 commit 8efa47b

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

Parser/myreadline.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,7 @@ PERFORMANCE OF THIS SOFTWARE.
3939
- a malloc'ed string ending in \n normally
4040
*/
4141

42-
#define Py_USE_NEW_NAMES 1
43-
44-
#include "config.h"
45-
46-
#include <stdio.h>
47-
#include <string.h>
48-
#include <errno.h>
49-
50-
#include "myproto.h"
51-
#include "mymalloc.h"
52-
#include "intrcheck.h"
42+
#include "Python.h"
5343

5444
int (*PyOS_InputHook)() = NULL;
5545

@@ -153,5 +143,7 @@ PyOS_Readline(prompt)
153143
if (PyOS_ReadlineFunctionPointer == NULL) {
154144
PyOS_ReadlineFunctionPointer = PyOS_StdioReadline;
155145
}
146+
Py_BEGIN_ALLOW_THREADS
156147
return (*PyOS_ReadlineFunctionPointer)(prompt);
148+
Py_END_ALLOW_THREADS
157149
}

0 commit comments

Comments
 (0)