diff options
author | ferrieux <ferrieux@users.sourceforge.net> | 2014-09-08 22:50:11 (GMT) |
---|---|---|
committer | ferrieux <ferrieux@users.sourceforge.net> | 2014-09-08 22:50:11 (GMT) |
commit | 04d10eb983cb26686f38383404b6b6ef9876f9e1 (patch) | |
tree | 616341bd368345187974ca138269b0281c8b3b6f /generic | |
parent | 07be9a8aa0887809dd6d79d2f079fa1d1558790e (diff) | |
download | tcl-04d10eb983cb26686f38383404b6b6ef9876f9e1.zip tcl-04d10eb983cb26686f38383404b6b6ef9876f9e1.tar.gz tcl-04d10eb983cb26686f38383404b6b6ef9876f9e1.tar.bz2 |
Refine TclFinalizeThreadData so that the quick-exit optimization really only affects exit.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclEvent.c | 23 | ||||
-rw-r--r-- | generic/tclThread.c | 7 |
2 files changed, 16 insertions, 14 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c index ab219a6..3985767 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -1299,20 +1299,17 @@ Tcl_FinalizeThread(void) TclFinalizeAsync(); TclFinalizeThreadObjects(); } - if (TclFullFinalizationRequested()) { /* useless if we are facing a quick-exit */ - /* - * Blow away all thread local storage blocks. - * - * Note that Tcl API allows creation of threads which do not use any Tcl - * interp or other Tcl subsytems. Those threads might, however, use thread - * local storage, so we must unconditionally finalize it. - * - * Fix [Bug #571002] - */ - - TclFinalizeThreadData(); - } + /* + * Blow away all thread local storage blocks. + * + * Note that Tcl API allows creation of threads which do not use any Tcl + * interp or other Tcl subsytems. Those threads might, however, use thread + * local storage, so we must unconditionally finalize it. + * + * Fix [Bug #571002] + */ + TclFinalizeThreadData(); } /* diff --git a/generic/tclThread.c b/generic/tclThread.c index 8c972a8..5ac6a8d 100644 --- a/generic/tclThread.c +++ b/generic/tclThread.c @@ -357,7 +357,12 @@ TclFinalizeThreadData(void) { TclFinalizeThreadDataThread(); #if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) - TclFinalizeThreadAllocThread(); + if ((!TclInExit())||TclFullFinalizationRequested()) { + /* + * Quick exit principle makes it useless to terminate allocators + */ + TclFinalizeThreadAllocThread(); + } #endif } |