summaryrefslogtreecommitdiffstats
path: root/generic/tclEvent.c
diff options
context:
space:
mode:
authormdejong <mdejong@noemail.net>2002-11-07 02:13:35 (GMT)
committermdejong <mdejong@noemail.net>2002-11-07 02:13:35 (GMT)
commit5eaa499a632bc6ecd456ac1faa409fdef624e070 (patch)
treef86db515375673b4202dbd6719d7bd881da96117 /generic/tclEvent.c
parentfdd7933bc7031a5752f663bb798bce3332d4444f (diff)
downloadtcl-5eaa499a632bc6ecd456ac1faa409fdef624e070.zip
tcl-5eaa499a632bc6ecd456ac1faa409fdef624e070.tar.gz
tcl-5eaa499a632bc6ecd456ac1faa409fdef624e070.tar.bz2
* generic/tclEvent.c (TclInExit, TclInThreadExit):
Split out functionality of TclInExit to make it clear which one should be called in each situation. * generic/tclInt.decls: Declare TclInThreadExit. * generic/tclIntDecls.h: Regen. * generic/tclStubInit.c: Regen. * mac/tclMacChan.c (StdIOClose): * unix/tclUnixChan.c (FileCloseProc): * win/tclWinChan.c (FileCloseProc): * win/tclWinConsole.c (ConsoleCloseProc): * win/tclWinPipe.c (TclpCloseFile): * win/tclWinSerial.c (SerialCloseProc): Invoke the new TclInThreadExit method instead of TclInExit. FossilOrigin-Name: de2cfbf168c353f2de6ec6db06bfb347b0ce9640
Diffstat (limited to 'generic/tclEvent.c')
-rw-r--r--generic/tclEvent.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index 27365a4..957c5f6 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclEvent.c,v 1.23 2002/08/05 03:24:40 dgp Exp $
+ * RCS: @(#) $Id: tclEvent.c,v 1.24 2002/11/07 02:13:36 mdejong Exp $
*/
#include "tclInt.h"
@@ -878,10 +878,6 @@ Tcl_FinalizeThread()
(ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
if (tsdPtr != NULL) {
- /*
- * Invoke thread exit handlers first.
- */
-
tsdPtr->inExit = 1;
/*
@@ -937,10 +933,32 @@ Tcl_FinalizeThread()
int
TclInExit()
{
+ return inFinalize;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclInThreadExit --
+ *
+ * Determines if we are in the middle of thread exit-time cleanup.
+ *
+ * Results:
+ * If we are in the middle of exiting this thread, 1, otherwise 0.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclInThreadExit()
+{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
TclThreadDataKeyGet(&dataKey);
if (tsdPtr == NULL) {
- return inFinalize;
+ return 0;
} else {
return tsdPtr->inExit;
}