diff options
author | hobbs <hobbs> | 2002-09-02 19:27:02 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-09-02 19:27:02 (GMT) |
commit | 12c500b4269224a1a10e57b3bfa53c605f080fd0 (patch) | |
tree | 325ea7c44557f02bdf695aab98dbd93a95279e3c /win | |
parent | bcc64cf044675bc2741a14a56cfd3a6688102018 (diff) | |
download | tcl-12c500b4269224a1a10e57b3bfa53c605f080fd0.zip tcl-12c500b4269224a1a10e57b3bfa53c605f080fd0.tar.gz tcl-12c500b4269224a1a10e57b3bfa53c605f080fd0.tar.bz2 |
* win/tclWinConsole.c (ConsoleCloseProc): only wait on writable
pipe if there was something to write. This may prevent infinite
wait on exit.
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinConsole.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index f233864..e864ab0 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinConsole.c,v 1.7 2002/01/15 17:55:30 dgp Exp $ + * RCS: @(#) $Id: tclWinConsole.c,v 1.8 2002/09/02 19:27:02 hobbs Exp $ */ #include "tclWinInt.h" @@ -503,7 +503,13 @@ ConsoleCloseProc( */ if (consolePtr->writeThread) { - WaitForSingleObject(consolePtr->writable, INFINITE); + if (consolePtr->toWrite) { + /* + * We only need to wait if there is something to write. + * This may prevent infinite wait on exit. [python bug 216289] + */ + WaitForSingleObject(consolePtr->writable, INFINITE); + } /* * Forcibly terminate the background thread. We cannot rely on the @@ -819,7 +825,7 @@ ConsoleEventProc( mask = 0; if (infoPtr->watchMask & TCL_WRITABLE) { if (WaitForSingleObject(infoPtr->writable, 0) != WAIT_TIMEOUT) { - mask = TCL_WRITABLE; + mask = TCL_WRITABLE; } } |