diff options
author | redman <redman> | 1999-07-27 01:42:21 (GMT) |
---|---|---|
committer | redman <redman> | 1999-07-27 01:42:21 (GMT) |
commit | fd9ef8bf5fa340e0b2995c55613fbaa12653dbb0 (patch) | |
tree | 9f2d4d9a9a9b32df258998390716ed7d9de546d0 /win/tclWinSock.c | |
parent | 1f5265171e2ddeade8350713feba432d2d862d2f (diff) | |
download | tcl-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/tclWinSock.c')
-rw-r--r-- | win/tclWinSock.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 7b63168..688df20 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinSock.c,v 1.13 1999/07/22 23:45:53 redman Exp $ + * RCS: @(#) $Id: tclWinSock.c,v 1.14 1999/07/27 01:42:25 redman Exp $ */ #include "tclWinInt.h" @@ -583,7 +583,16 @@ SocketThreadExitHandler(clientData) (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey); if (tsdPtr->socketThread != NULL) { + Tcl_MutexLock(&socketMutex); TerminateThread(tsdPtr->socketThread, 0); + + /* + * Wait for the thread to terminate. This ensures that we are + * completely cleaned up before we leave this function. + */ + + WaitForSingleObject(tsdPtr->socketThread, INFINITE); + Tcl_MutexUnlock(&socketMutex); } if (tsdPtr->hwnd != NULL) { DestroyWindow(tsdPtr->hwnd); |