summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredman <redman>1999-07-29 22:58:22 (GMT)
committerredman <redman>1999-07-29 22:58:22 (GMT)
commit2a5093e8452e5ec2c6d52b77e936eda1508cb2f1 (patch)
tree021c3a6e1efae004d9d428b21de45f1bb6656848
parent832069eb84869a95bdf0741125e34bc2e672eee1 (diff)
downloadtcl-2a5093e8452e5ec2c6d52b77e936eda1508cb2f1.zip
tcl-2a5093e8452e5ec2c6d52b77e936eda1508cb2f1.tar.gz
tcl-2a5093e8452e5ec2c6d52b77e936eda1508cb2f1.tar.bz2
win/tclWinSock.c: free Win32 Event handles when destroying socket
helper threads.
-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) {