summaryrefslogtreecommitdiffstats
path: root/mac
diff options
context:
space:
mode:
authorvasiljevic <zv@archiware.com>2006-03-10 14:27:41 (GMT)
committervasiljevic <zv@archiware.com>2006-03-10 14:27:41 (GMT)
commit5e0d82e5a916c0a59ba7a2827b695d74886edcf3 (patch)
tree86eba32429c18cbbfffae4fe58b94a6695273b02 /mac
parent23596eee23da84c3e56fadc163dc8a2734b8f453 (diff)
downloadtcl-5e0d82e5a916c0a59ba7a2827b695d74886edcf3.zip
tcl-5e0d82e5a916c0a59ba7a2827b695d74886edcf3.tar.gz
tcl-5e0d82e5a916c0a59ba7a2827b695d74886edcf3.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).
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); */
}
}