summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredman <redman@noemail.net>1999-07-29 22:58:21 (GMT)
committerredman <redman@noemail.net>1999-07-29 22:58:21 (GMT)
commitb3bbacf74b2c95a9fe4d27817ef08710ee17766e (patch)
tree021c3a6e1efae004d9d428b21de45f1bb6656848
parentbb2a71d83fe61d0e1f0f25486ca16f880ec6e7d6 (diff)
downloadtcl-b3bbacf74b2c95a9fe4d27817ef08710ee17766e.zip
tcl-b3bbacf74b2c95a9fe4d27817ef08710ee17766e.tar.gz
tcl-b3bbacf74b2c95a9fe4d27817ef08710ee17766e.tar.bz2
win/tclWinSock.c: free Win32 Event handles when destroying socket
helper threads. FossilOrigin-Name: 5d8a109496dd29a2ee9cac9e9258a87131c314a2
-rw-r--r--ChangeLog7
-rw-r--r--win/tclWinSock.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0b8f05d..0a51b5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-1999-07-28 Jennifer Hom <jenn@scriptics.com>
+1999-07-29 <redman@scriptics.com>
+
+ * win/tclWinSock.c: Free Win32 Event handles when destroying
+ the socket helper thread.
+
+1999-07-28 <jenn@scriptics.com>
* tests/tcltest.test:
* library/tcltest1.0/tcltest.tcl: Fixed the condition under which
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 688df20..7d6651f 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.14 1999/07/27 01:42:25 redman Exp $
+ * RCS: @(#) $Id: tclWinSock.c,v 1.15 1999/07/29 22:58:24 redman Exp $
*/
#include "tclWinInt.h"
@@ -489,6 +489,7 @@ unloadLibrary:
tsdPtr->socketThread = NULL;
}
CloseHandle(tsdPtr->readyEvent);
+ CloseHandle(tsdPtr->socketListLock);
}
FreeLibrary(winSock.hInstance);
winSock.hInstance = NULL;
@@ -583,6 +584,8 @@ SocketThreadExitHandler(clientData)
(ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (tsdPtr->socketThread != NULL) {
+
+ WaitForSingleObject(tsdPtr->socketListLock, INFINITE);
Tcl_MutexLock(&socketMutex);
TerminateThread(tsdPtr->socketThread, 0);
@@ -592,6 +595,8 @@ SocketThreadExitHandler(clientData)
*/
WaitForSingleObject(tsdPtr->socketThread, INFINITE);
+ CloseHandle(tsdPtr->readyEvent);
+ CloseHandle(tsdPtr->socketListLock);
Tcl_MutexUnlock(&socketMutex);
}
if (tsdPtr->hwnd != NULL) {