replace thread state objects' ticker and checkinterval fields with two

globals, _Py_Ticker and _Py_CheckInterval.  This also implements Jeremy's
shortcut in Py_AddPendingCall that zeroes out _Py_Ticker.  This allows the
test in the main loop to only test a single value.

The gory details are at

    http://python.org/sf/602191
This commit is contained in:
Skip Montanaro 2002-09-03 20:10:45 +00:00
parent d229b3ae04
commit d581d7792b
5 changed files with 15 additions and 10 deletions

View file

@ -28,11 +28,9 @@ static PyLongObject *muladd1(PyLongObject *, wdigit, wdigit);
static PyLongObject *divrem1(PyLongObject *, digit, digit *);
static PyObject *long_format(PyObject *aa, int base, int addL);
static int ticker; /* XXX Could be shared with ceval? */
#define SIGCHECK(PyTryBlock) \
if (--ticker < 0) { \
ticker = 100; \
if (--_Py_Ticker < 0) { \
_Py_Ticker = _Py_CheckInterval; \
if (PyErr_CheckSignals()) { PyTryBlock; } \
}