mirror of
https://github.com/python/cpython.git
synced 2025-11-17 01:25:57 +00:00
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()).
This commit is contained in:
parent
44ee479427
commit
8efa47b63e
1 changed files with 3 additions and 11 deletions
|
|
@ -39,17 +39,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||||
- a malloc'ed string ending in \n normally
|
- a malloc'ed string ending in \n normally
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Py_USE_NEW_NAMES 1
|
#include "Python.h"
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "myproto.h"
|
|
||||||
#include "mymalloc.h"
|
|
||||||
#include "intrcheck.h"
|
|
||||||
|
|
||||||
int (*PyOS_InputHook)() = NULL;
|
int (*PyOS_InputHook)() = NULL;
|
||||||
|
|
||||||
|
|
@ -153,5 +143,7 @@ PyOS_Readline(prompt)
|
||||||
if (PyOS_ReadlineFunctionPointer == NULL) {
|
if (PyOS_ReadlineFunctionPointer == NULL) {
|
||||||
PyOS_ReadlineFunctionPointer = PyOS_StdioReadline;
|
PyOS_ReadlineFunctionPointer = PyOS_StdioReadline;
|
||||||
}
|
}
|
||||||
|
Py_BEGIN_ALLOW_THREADS
|
||||||
return (*PyOS_ReadlineFunctionPointer)(prompt);
|
return (*PyOS_ReadlineFunctionPointer)(prompt);
|
||||||
|
Py_END_ALLOW_THREADS
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue