summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2017-07-10 10:58:42 (GMT)
committersebres <sebres@users.sourceforge.net>2017-07-10 10:58:42 (GMT)
commit8383ac341f0de983f9df6eb589ee893a2ac11aba (patch)
tree74343692a84ad63128be4d3d65028f88f7b567d7
parentacd0d32a48312257b175680de2a743a2e31510cc (diff)
downloadtcl-8383ac341f0de983f9df6eb589ee893a2ac11aba.zip
tcl-8383ac341f0de983f9df6eb589ee893a2ac11aba.tar.gz
tcl-8383ac341f0de983f9df6eb589ee893a2ac11aba.tar.bz2
avoid blocking wait if we've some retarded events (from last event-cycle) and max blocking time was not set outside an event source traversal.
-rw-r--r--generic/tclNotify.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/generic/tclNotify.c b/generic/tclNotify.c
index baed116..28c3879 100644
--- a/generic/tclNotify.c
+++ b/generic/tclNotify.c
@@ -1077,6 +1077,18 @@ SetUpEventSources(
}
tsdPtr->inTraversal--;
+ /*
+ * If we've some retarded events (from last event-cycle), wait non-blocking.
+ */
+ if ( tsdPtr->firstRetardEv
+ && ( !tsdPtr->blockTimeSet
+ || tsdPtr->blockTimeServLev < tsdPtr->serviceLevel )
+ ) {
+ tsdPtr->blockTime.sec = 0;
+ tsdPtr->blockTime.usec = 0;
+ tsdPtr->blockTimeSet = 1;
+ }
+
return res;
}