summaryrefslogtreecommitdiffstats
path: root/mac
diff options
context:
space:
mode:
authorvasiljevic <vasiljevic@noemail.net>2006-03-10 14:27:41 (GMT)
committervasiljevic <vasiljevic@noemail.net>2006-03-10 14:27:41 (GMT)
commitc79d326ebf3f9e8cd3944d132b4872d3aadc31da (patch)
tree86eba32429c18cbbfffae4fe58b94a6695273b02 /mac
parent816f9dd7053ccdde9894e86ab4b2acf895315f62 (diff)
downloadtcl-c79d326ebf3f9e8cd3944d132b4872d3aadc31da.zip
tcl-c79d326ebf3f9e8cd3944d132b4872d3aadc31da.tar.gz
tcl-c79d326ebf3f9e8cd3944d132b4872d3aadc31da.tar.bz2
Finalization of the sockets is now solely done in
TclpFinalizeSockets() and not over the thread-exit handler, because the order of actions the Tcl generic core will impose may result in cores/hangs if the thread exit handler tears down socket subsystem too early (See Tcl Bug #1437595). FossilOrigin-Name: f79750f1ba666703a4c13da105b3316cbb740180
Diffstat (limited to 'mac')
-rw-r--r--mac/tclMacSock.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/mac/tclMacSock.c b/mac/tclMacSock.c
index f272f87..195182e 100644
--- a/mac/tclMacSock.c
+++ b/mac/tclMacSock.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: tclMacSock.c,v 1.14 2002/04/08 09:03:17 das Exp $
+ * RCS: @(#) $Id: tclMacSock.c,v 1.14.2.1 2006/03/10 14:27:41 vasiljevic Exp $
*/
#include "tclInt.h"
@@ -159,7 +159,6 @@ static void SocketCheckProc _ANSI_ARGS_((ClientData clientData,
int flags));
static int SocketEventProc _ANSI_ARGS_((Tcl_Event *evPtr,
int flags));
-static void SocketExitHandler _ANSI_ARGS_((ClientData clientData));
static void SocketFreeProc _ANSI_ARGS_((ClientData clientData));
static int SocketReady _ANSI_ARGS_((TcpState *statePtr));
static void SocketSetupProc _ANSI_ARGS_((ClientData clientData,
@@ -367,37 +366,36 @@ InitSockets()
tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (tsdPtr == NULL) {
+ tsdPtr = TCL_TSD_INIT(&dataKey);
tsdPtr->socketList = NULL;
Tcl_CreateEventSource(SocketSetupProc, SocketCheckProc, NULL);
- Tcl_CreateThreadExitHandler(SocketExitHandler, (ClientData) NULL);
}
}
/*
*----------------------------------------------------------------------
*
- * SocketExitHandler --
+ * TclpFinalizeSockets --
*
- * Callback invoked during exit clean up to deinitialize the
- * socket module.
+ * Invoked during exit clean up to deinitialize the socket module.
*
* Results:
* None.
*
* Side effects:
- * None.
+ * Removed event source.
*
*----------------------------------------------------------------------
*/
-static void
-SocketExitHandler(
- ClientData clientData) /* Not used. */
+void
+TclpFinalizeSockets()
{
- if (hasSockets) {
+ ThreadSpecificData *tsdPtr;
+
+ tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
+ if (tsdPtr != NULL) {
Tcl_DeleteEventSource(SocketSetupProc, SocketCheckProc, NULL);
- /* CleanUpExitProc();
- TclMacDeleteExitToShellPatch(CleanUpExitProc); */
}
}