summaryrefslogtreecommitdiffstats
path: root/win/tclWinPipe.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/tclWinPipe.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/tclWinPipe.c')
-rw-r--r--win/tclWinPipe.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 6d182fa..565445e 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.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: tclWinPipe.c,v 1.6 1999/05/21 18:28:45 redman Exp $
+ * RCS: @(#) $Id: tclWinPipe.c,v 1.7 1999/07/27 01:42:25 redman Exp $
*/
#include "tclWinInt.h"
@@ -2164,7 +2164,6 @@ PipeClose2Proc(
Tcl_MutexLock(&pipeMutex);
TerminateThread(pipePtr->readThread, 0);
- Tcl_MutexUnlock(&pipeMutex);
/*
* Wait for the thread to terminate. This ensures that we are
@@ -2172,6 +2171,8 @@ PipeClose2Proc(
*/
WaitForSingleObject(pipePtr->readThread, INFINITE);
+ Tcl_MutexUnlock(&pipeMutex);
+
CloseHandle(pipePtr->readThread);
CloseHandle(pipePtr->readable);
CloseHandle(pipePtr->startReader);
@@ -2206,8 +2207,6 @@ PipeClose2Proc(
Tcl_MutexLock(&pipeMutex);
TerminateThread(pipePtr->writeThread, 0);
- Tcl_MutexUnlock(&pipeMutex);
-
/*
* Wait for the thread to terminate. This ensures that we are
@@ -2215,6 +2214,9 @@ PipeClose2Proc(
*/
WaitForSingleObject(pipePtr->writeThread, INFINITE);
+ Tcl_MutexUnlock(&pipeMutex);
+
+
CloseHandle(pipePtr->writeThread);
CloseHandle(pipePtr->writable);
CloseHandle(pipePtr->startWriter);