[Python-checkins] python/dist/src/Objects longobject.c,1.142,1.143

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
Tue, 03 Sep 2002 13:10:48 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv1832/Objects

Modified Files:
	longobject.c 
Log Message:
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



Index: longobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -C2 -d -r1.142 -r1.143
*** longobject.c	20 Aug 2002 19:00:22 -0000	1.142
--- longobject.c	3 Sep 2002 20:10:45 -0000	1.143
***************
*** 29,37 ****
  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 (PyErr_CheckSignals()) { PyTryBlock; } \
  	}
--- 29,35 ----
  static PyObject *long_format(PyObject *aa, int base, int addL);
  
  #define SIGCHECK(PyTryBlock) \
! 	if (--_Py_Ticker < 0) { \
! 		_Py_Ticker = _Py_CheckInterval; \
  		if (PyErr_CheckSignals()) { PyTryBlock; } \
  	}