summaryrefslogtreecommitdiffstats
path: root/win/tclWinConsole.c
diff options
context:
space:
mode:
authorredman <redman>1999-07-27 01:42:21 (GMT)
committerredman <redman>1999-07-27 01:42:21 (GMT)
commitfd9ef8bf5fa340e0b2995c55613fbaa12653dbb0 (patch)
tree9f2d4d9a9a9b32df258998390716ed7d9de546d0 /win/tclWinConsole.c
parent1f5265171e2ddeade8350713feba432d2d862d2f (diff)
downloadtcl-fd9ef8bf5fa340e0b2995c55613fbaa12653dbb0.zip
tcl-fd9ef8bf5fa340e0b2995c55613fbaa12653dbb0.tar.gz
tcl-fd9ef8bf5fa340e0b2995c55613fbaa12653dbb0.tar.bz2
Bug fixes for threaded Tcl on NT with single and dual CPUs. Still some
open issues, this code is a little more stable though.
Diffstat (limited to 'win/tclWinConsole.c')
-rw-r--r--win/tclWinConsole.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index bd50859..7d62a5a 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.2 1999/04/16 00:48:07 stanton Exp $
+ * RCS: @(#) $Id: tclWinConsole.c,v 1.3 1999/07/27 01:42:25 redman Exp $
*/
#include "tclWinInt.h"
@@ -486,7 +486,6 @@ ConsoleCloseProc(
Tcl_MutexLock(&consoleMutex);
TerminateThread(consolePtr->readThread, 0);
- Tcl_MutexUnlock(&consoleMutex);
/*
* Wait for the thread to terminate. This ensures that we are
@@ -494,6 +493,8 @@ ConsoleCloseProc(
*/
WaitForSingleObject(consolePtr->readThread, INFINITE);
+ Tcl_MutexUnlock(&consoleMutex);
+
CloseHandle(consolePtr->readThread);
CloseHandle(consolePtr->readable);
CloseHandle(consolePtr->startReader);
@@ -522,7 +523,6 @@ ConsoleCloseProc(
Tcl_MutexLock(&consoleMutex);
TerminateThread(consolePtr->writeThread, 0);
- Tcl_MutexUnlock(&consoleMutex);
/*
* Wait for the thread to terminate. This ensures that we are
@@ -530,6 +530,8 @@ ConsoleCloseProc(
*/
WaitForSingleObject(consolePtr->writeThread, INFINITE);
+ Tcl_MutexUnlock(&consoleMutex);
+
CloseHandle(consolePtr->writeThread);
CloseHandle(consolePtr->writable);
CloseHandle(consolePtr->startWriter);