summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-12-28 10:05:21 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-12-28 10:05:21 (GMT)
commit269f443b722116c9623cfee0c4d3c79318342565 (patch)
treeff038ef2bc0c6023857d4d67b2a487b9b383a295 /generic
parent0d01ef9eb8b4f1e51b3b2401f02f0b7aa6c92ecc (diff)
downloadtcl-269f443b722116c9623cfee0c4d3c79318342565.zip
tcl-269f443b722116c9623cfee0c4d3c79318342565.tar.gz
tcl-269f443b722116c9623cfee0c4d3c79318342565.tar.bz2
[Bug 2891362]: Make time limits work better with the event loop.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclInterp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index 67a031a..6ff8cea 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclInterp.c,v 1.83.2.2 2008/07/21 19:38:19 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclInterp.c,v 1.83.2.3 2009/12/28 10:05:22 dkf Exp $
*/
#include "tclInt.h"
@@ -3603,10 +3603,20 @@ TimeLimitCallback(
ClientData clientData)
{
Tcl_Interp *interp = clientData;
+ Interp *iPtr = clientData;
int code;
Tcl_Preserve(interp);
- ((Interp *)interp)->limit.timeEvent = NULL;
+ iPtr->limit.timeEvent = NULL;
+
+ /*
+ * Must reset the granularity ticker here to force an immediate full
+ * check. This is OK because we're swallowing the cost in the overall cost
+ * of the event loop. [Bug 2891362]
+ */
+
+ iPtr->limit.granularityTicker = 0;
+
code = Tcl_LimitCheck(interp);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp, "\n (while waiting for event)");