summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-04-04 17:31:59 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-04-04 17:31:59 (GMT)
commitf645033318ef3df0653babe269de18aebcca34f1 (patch)
tree5d756d4272363107ce00a45a57317b390c1299e4
parent543a9cb0f2306de1770f95ba67834ae3409ca065 (diff)
downloadtcl-f645033318ef3df0653babe269de18aebcca34f1.zip
tcl-f645033318ef3df0653babe269de18aebcca34f1.tar.gz
tcl-f645033318ef3df0653babe269de18aebcca34f1.tar.bz2
Fix [Bug 1910136].
-rw-r--r--ChangeLog19
-rw-r--r--doc/vwait.n32
2 files changed, 39 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index f33e2bf..ec0289f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,18 +1,23 @@
+2009-04-04 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/vwait.n: [Bug 1910136]: Extend description and examples to make
+ it clearer just how this command interprets variable names.
+
2009-03-30 Don Porter <dgp@users.sourceforge.net>
- * doc/Alloc.3: Size argument is "unsigned int". [Bug 2556263]
+ * doc/Alloc.3: [Bug 2556263]: Size argument is "unsigned int".
2009-03-27 Don Porter <dgp@users.sourceforge.net>
- * generic/tclPathObj.c (TclPathPart): TclPathPart() was computing
- * tests/fileName.test: the wrong results for both [file dirname] and
- [file tail] on "path" arguments with the PATHFLAGS != 0 intrep and
- with an empty string for the "joined-on" part. [Bug 2710920]
+ * generic/tclPathObj.c (TclPathPart): [Bug 2710920]: TclPathPart()
+ * tests/fileName.test: was computing the wrong results for both [file
+ dirname] and [file tail] on "path" arguments with the PATHFLAGS != 0
+ intrep and with an empty string for the "joined-on" part.
2009-03-25 Jan Nijtmans <nijtmans@users.sf.net>
- * doc/tclsh.1 bring doc and tools in line with http://wiki.tcl.tk/812
- * tools/installData.tcl
+ * doc/tclsh.1: Bring doc and tools in line with
+ * tools/installData.tcl: http://wiki.tcl.tk/812
* tools/str2c
* tools/tcltk-man2html.tcl
diff --git a/doc/vwait.n b/doc/vwait.n
index 89796c6..fb62fdf 100644
--- a/doc/vwait.n
+++ b/doc/vwait.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: vwait.n,v 1.8 2008/10/17 10:22:25 dkf Exp $
+'\" RCS: @(#) $Id: vwait.n,v 1.9 2009/04/04 17:32:00 dkf Exp $
'\"
.so man.macros
.TH vwait n 8.0 Tcl "Tcl Built-In Commands"
@@ -19,12 +19,12 @@ vwait \- Process events until a variable is written
.PP
This command enters the Tcl event loop to process events, blocking
the application if no events are ready. It continues processing
-events until some event handler sets the value of variable
+events until some event handler sets the value of the global variable
\fIvarName\fR. Once \fIvarName\fR has been set, the \fBvwait\fR
command will return as soon as the event handler that modified
-\fIvarName\fR completes. \fIvarName\fR must be globally scoped
-(either with a call to \fBglobal\fR for the \fIvarName\fR, or with
-the full namespace path specification).
+\fIvarName\fR completes. The \fIvarName\fR argument is always interpreted as
+a variable name with respect to the global namespace, but can refer to any
+namespace's variables if the fully-qualified name is given.
.PP
In some cases the \fBvwait\fR command may not return immediately
after \fIvarName\fR is set. This can happen if the event handler
@@ -75,7 +75,29 @@ switch $state {
}
}
.CE
+.PP
+A command that will wait for some time delay by waiting for a namespace
+variable to be set. Includes an interlock to prevent nested waits.
+.PP
+.CS
+namespace eval example {
+ variable v done
+ proc wait {delay} {
+ variable v
+ if {$v ne "waiting"} {
+ set v waiting
+ after $delay [namespace code {set v done}]
+ \fBvwait\fR [namespace which -variable v]
+ }
+ return $v
+ }
+}
+.CE
.SH "SEE ALSO"
global(n), update(n)
.SH KEYWORDS
event, variable, wait
+'\" Local Variables:
+'\" mode: nroff
+'\" fill-column: 78
+'\" End: