diff options
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | doc/vwait.n | 32 |
2 files changed, 39 insertions, 12 deletions
@@ -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: |