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

@ -48,6 +48,10 @@ PyAPI_FUNC(int) Py_GetRecursionLimit(void);
PyAPI_FUNC(char *) PyEval_GetFuncName(PyObject *);
PyAPI_FUNC(char *) PyEval_GetFuncDesc(PyObject *);
/* this used to be handled on a per-thread basis - now just two globals */
PyAPI_DATA(volatile int) _Py_Ticker;
PyAPI_DATA(int) _Py_CheckInterval;
/* Interface for threads.
A module that plans to do a blocking system call (or something else

View file

@ -22,7 +22,6 @@ typedef struct _is {
PyObject *sysdict;
PyObject *builtins;
int checkinterval;
#ifdef HAVE_DLOPEN
int dlopenflags;
#endif
@ -50,7 +49,6 @@ typedef struct _ts {
struct _frame *frame;
int recursion_depth;
int ticker;
int tracing;
int use_tracing;