diff options
Diffstat (limited to 'win/tclWinSock.c')
-rw-r--r-- | win/tclWinSock.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c index a790b31..b52b4f3 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.41 2003/12/24 04:18:23 davygrvy Exp $ + * RCS: @(#) $Id: tclWinSock.c,v 1.42 2004/02/21 02:17:31 davygrvy Exp $ */ #include "tclWinInt.h" @@ -626,24 +626,15 @@ SocketThreadExitHandler(clientData) GetExitCodeThread(tsdPtr->socketThread, &exitCode); if (exitCode == STILL_ACTIVE) { - DWORD dwWait; PostMessage(tsdPtr->hwnd, SOCKET_TERMINATE, 0, 0); - /* * Wait for the thread to close. This ensures that we are - * completely cleaned up before we leave this function. + * completely cleaned up before we leave this function. + * If Tcl_Finalize was called from DllMain, the thread + * is in a paused state so we need to timeout and continue. */ - dwWait = WaitForSingleObject(tsdPtr->socketThread, 100); - if (dwWait == WAIT_TIMEOUT) { - /* - * Avoids a lock-up, just in case it is needed from an - * unclean exit condition when the thread appears - * running, but isn't. - */ - - TerminateThread(tsdPtr->socketThread, EXIT_FAILURE); - } + WaitForSingleObject(tsdPtr->socketThread, 100); } CloseHandle(tsdPtr->socketThread); tsdPtr->socketThread = NULL; |