From 12c500b4269224a1a10e57b3bfa53c605f080fd0 Mon Sep 17 00:00:00 2001 From: hobbs Date: Mon, 2 Sep 2002 19:27:02 +0000 Subject: * win/tclWinConsole.c (ConsoleCloseProc): only wait on writable pipe if there was something to write. This may prevent infinite wait on exit. --- win/tclWinConsole.c | 12 +++++++++--- 1 file 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; } } -- cgit v0.12