diff options
author | mdejong <mdejong> | 2002-11-07 02:13:35 (GMT) |
---|---|---|
committer | mdejong <mdejong> | 2002-11-07 02:13:35 (GMT) |
commit | 3e430e0f904e6835386a38276d1e7db4abe08e01 (patch) | |
tree | f86db515375673b4202dbd6719d7bd881da96117 /generic/tclEvent.c | |
parent | c8da171d49ce9c4601c168ee22fb991d7a0da3b5 (diff) | |
download | tcl-3e430e0f904e6835386a38276d1e7db4abe08e01.zip tcl-3e430e0f904e6835386a38276d1e7db4abe08e01.tar.gz tcl-3e430e0f904e6835386a38276d1e7db4abe08e01.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.
Diffstat (limited to 'generic/tclEvent.c')
-rw-r--r-- | generic/tclEvent.c | 30 |
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; } |