summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorvasiljevic <zv@archiware.com>2006-03-10 14:18:54 (GMT)
committervasiljevic <zv@archiware.com>2006-03-10 14:18:54 (GMT)
commit08a3195989ceab4f125251811949e85431265fec (patch)
tree0d0fa0ea47c92e51a7980cf8ce16dc0fc5ea866d /win
parent27a60bbb6e8ed74aee449f6f51e1bade58953942 (diff)
downloadtcl-08a3195989ceab4f125251811949e85431265fec.zip
tcl-08a3195989ceab4f125251811949e85431265fec.tar.gz
tcl-08a3195989ceab4f125251811949e85431265fec.tar.bz2
Finalization of the pipes are now solely done in TclpFinalizePipes 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 tearis down pipes too early (see Bug # 1437595).
Diffstat (limited to 'win')
-rw-r--r--win/tclWinPipe.c45
1 files changed, 11 insertions, 34 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 8dc41d0..e599b50 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinPipe.c,v 1.33.2.15 2005/11/04 18:33:35 patthoyts Exp $
+ * RCS: @(#) $Id: tclWinPipe.c,v 1.33.2.16 2006/03/10 14:18:54 vasiljevic Exp $
*/
#include "tclWinInt.h"
@@ -189,7 +189,6 @@ static void PipeCheckProc(ClientData clientData, int flags);
static int PipeClose2Proc(ClientData instanceData,
Tcl_Interp *interp, int flags);
static int PipeEventProc(Tcl_Event *evPtr, int flags);
-static void PipeExitHandler(ClientData clientData);
static int PipeGetHandleProc(ClientData instanceData,
int direction, ClientData *handlePtr);
static void PipeInit(void);
@@ -271,57 +270,35 @@ PipeInit()
tsdPtr = TCL_TSD_INIT(&dataKey);
tsdPtr->firstPipePtr = NULL;
Tcl_CreateEventSource(PipeSetupProc, PipeCheckProc, NULL);
- Tcl_CreateThreadExitHandler(PipeExitHandler, NULL);
}
}
/*
*----------------------------------------------------------------------
*
- * PipeExitHandler --
- *
- * This function is called to cleanup the pipe module before
- * Tcl is unloaded.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Removes the pipe event source.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-PipeExitHandler(
- ClientData clientData) /* Old window proc */
-{
- Tcl_DeleteEventSource(PipeSetupProc, PipeCheckProc, NULL);
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TclpFinalizePipes --
*
- * This function is called to cleanup the process list before
- * Tcl is unloaded.
+ * This function is called from Tcl_FinalizeThread to finalize the
+ * platform specific pipe subsystem.
*
* Results:
* None.
*
* Side effects:
- * Resets the process list.
+ * Removes the pipe event source.
*
*----------------------------------------------------------------------
*/
void
TclpFinalizePipes()
-{
- Tcl_MutexLock(&pipeMutex);
- initialized = 0;
- Tcl_MutexUnlock(&pipeMutex);
+{
+ ThreadSpecificData *tsdPtr;
+
+ tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
+ if (tsdPtr != NULL) {
+ Tcl_DeleteEventSource(PipeSetupProc, PipeCheckProc, NULL);
+ }
}
/*