summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2017-07-03 13:29:58 (GMT)
committersebres <sebres@users.sourceforge.net>2017-07-03 13:29:58 (GMT)
commit96076219018ba504254a342c4490fc787bb0ceae (patch)
treed09bfe1ad6d26a5a46c4d5a8ae8c84d5a17b66a2
parent345ea34a7e160b62787cd3397d80dce03a4d1ee6 (diff)
downloadtcl-96076219018ba504254a342c4490fc787bb0ceae.zip
tcl-96076219018ba504254a342c4490fc787bb0ceae.tar.gz
tcl-96076219018ba504254a342c4490fc787bb0ceae.tar.bz2
don't use tolerance in vwait, because of dual usage, it causes canceling of wait before end-time, on small timeout values (like 0.5, etc.)
-rw-r--r--generic/tclEvent.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index 9a20cc2..b5e73ea 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -1386,7 +1386,6 @@ Tcl_VwaitObjCmd(
int optc = objc - 2; /* options count without cmd and varname */
Tcl_WideInt usec = -1;
Tcl_WideInt lastNow = 0, wakeup = 0;
- long tolerance = 0;
size_t timeJumpEpoch = 0;
if (objc < 2) {
@@ -1420,11 +1419,6 @@ Tcl_VwaitObjCmd(
if (usec > 0) {
lastNow = TclpGetMicroseconds();
timeJumpEpoch = TclpGetLastTimeJumpEpoch();
- #ifdef TMR_RES_TOLERANCE
- tolerance = (usec < 1000000 ? usec : 1000000) *
- TMR_RES_TOLERANCE / 100;
- usec += tolerance / 3;
- #endif
wakeup = lastNow + usec;
} else {
flags |= TCL_DONT_WAIT;
@@ -1457,9 +1451,9 @@ Tcl_VwaitObjCmd(
/* calculate blocking time */
lastNow = now;
diff = wakeup - now;
- diff -= 1; /* overhead for Tcl_TraceVar / Tcl_UntraceVar */
+ diff -= 1; /* overhead for this code (e. g. Tcl_TraceVar/Tcl_UntraceVar) */
/* be sure process at least one event */
- if (diff <= tolerance) {
+ if (diff <= 0) {
/* timeout occurs */
if (checktime) {
done = -1;