|
From: David B. <dav...@us...> - 2004-12-05 18:02:20
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31838 Modified Files: Tag: sidewinder-branch langpython.c Log Message: overzealous locking leads to dead applications Index: langpython.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langpython.c,v retrieving revision 1.2.4.27 retrieving revision 1.2.4.28 diff -C2 -d -r1.2.4.27 -r1.2.4.28 *** langpython.c 5 Dec 2004 02:19:06 -0000 1.2.4.27 --- langpython.c 5 Dec 2004 18:02:06 -0000 1.2.4.28 *************** *** 1512,1515 **** --- 1512,1519 ---- static PyObject * + Script_getattr(frontier_ScriptObject *self, char *name) { + } + + static PyObject * Script_call(frontier_ScriptObject *self, PyObject *args, PyObject *kw) { tyvaluerecord params, retval; *************** *** 1544,1556 **** // call the script ! releasepythonlock(); if (!langexternalgetquotedpath(self->parent, self->name, funcname)) { ! getpythonlock(); goto exitnone; } if (!langrunscript(funcname, ¶ms, nil, &retval)) { ! getpythonlock(); goto exitnone; } --- 1548,1560 ---- // call the script ! //releasepythonlock(); if (!langexternalgetquotedpath(self->parent, self->name, funcname)) { ! //getpythonlock(); goto exitnone; } if (!langrunscript(funcname, ¶ms, nil, &retval)) { ! //getpythonlock(); goto exitnone; } *************** *** 1760,1771 **** } static int checkstatus(PyObject *o, PyFrameObject *frame, int what, PyObject *arg) { - //printf("check\n"); - //if (keyboardescape()) { if (!langbackgroundtask(false)) { - //printf("hit\n"); PyErr_SetInterrupt(); } return 0; } --- 1764,1778 ---- } + static int checkCount = 0; + static int checkQuantum = 100; + static int checkstatus(PyObject *o, PyFrameObject *frame, int what, PyObject *arg) { if (!langbackgroundtask(false)) { PyErr_SetInterrupt(); } + checkCount++; + if ((checkCount % checkQuantum) == 0) + processyield(); return 0; } |