Message188499
My quick and dirty fix is simple:
_PyOS_ReadlineTState = PyThreadState_GET();
/* CCP change, cannot release the GIL here because PyOS_StdioReadline uses
* the regular MALLOC
*/
/*
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
* a tty. This can happen, for example if python is run like
* this: python -i < test1.py
*/
if (!isatty (fileno (sys_stdin)) || !isatty (fileno (sys_stdout)))
rv = PyOS_StdioReadline (sys_stdin, sys_stdout, prompt);
else
rv = (*PyOS_ReadlineFunctionPointer)(sys_stdin, sys_stdout,
prompt);
/*
Py_END_ALLOW_THREADS
*/
#ifdef WITH_THREAD
PyThread_release_lock(_PyOS_ReadlineLock);
#endif
Basically, we just comment out the lock release since we don't need it. The reason we found this was that we were using GIL a custom mallocator which should have been run with the GIL but wasn´t. |
|
Date |
User |
Action |
Args |
2013-05-06 09:35:21 | kristjan.jonsson | set | recipients:
+ kristjan.jonsson, gregory.p.smith, pitrou, trent, meador.inge |
2013-05-06 09:35:21 | kristjan.jonsson | set | messageid: <1367832921.25.0.300064169781.issue16742@psf.upfronthosting.co.za> |
2013-05-06 09:35:21 | kristjan.jonsson | link | issue16742 messages |
2013-05-06 09:35:21 | kristjan.jonsson | create | |
|