aboutsummaryrefslogtreecommitdiff
path: root/contrib/tcl/generic/tclNotify.c
diff options
context:
space:
mode:
authorPaul Traina <pst@FreeBSD.org>1997-11-27 19:49:05 +0000
committerPaul Traina <pst@FreeBSD.org>1997-11-27 19:49:05 +0000
commitf25b19db8d50748d4f75272ae324cad27788d9b3 (patch)
treecef0bba69f1833802f43364a0cde6945601e665a /contrib/tcl/generic/tclNotify.c
parent539e1e66ff6f99c987c8e03872ddaea5260db8f7 (diff)
Notes
Diffstat (limited to 'contrib/tcl/generic/tclNotify.c')
-rw-r--r--contrib/tcl/generic/tclNotify.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/contrib/tcl/generic/tclNotify.c b/contrib/tcl/generic/tclNotify.c
index 19f38f3282ed..939624881527 100644
--- a/contrib/tcl/generic/tclNotify.c
+++ b/contrib/tcl/generic/tclNotify.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * SCCS: @(#) tclNotify.c 1.15 97/06/18 17:14:04
+ * SCCS: @(#) tclNotify.c 1.16 97/09/15 15:12:52
*/
#include "tclInt.h"
@@ -761,6 +761,25 @@ Tcl_DoOneEvent(flags)
if (flags & TCL_DONT_WAIT) {
break;
}
+
+ /*
+ * If Tcl_WaitForEvent has returned 1,
+ * indicating that one system event has been dispatched
+ * (and thus that some Tcl code might have been indirectly executed),
+ * we break out of the loop.
+ * We do this to give VwaitCmd for instance a chance to check
+ * if that system event had the side effect of changing the
+ * variable (so the vwait can return and unwind properly).
+ *
+ * NB: We will process idle events if any first, because
+ * otherwise we might never do the idle events if the notifier
+ * always gets system events.
+ */
+
+ if (result) {
+ break;
+ }
+
}
notifier.serviceMode = oldMode;