diff options
author | dgp <dgp@users.sourceforge.net> | 2005-04-12 20:28:37 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2005-04-12 20:28:37 (GMT) |
commit | e691fce6b050292abd74b38b28886b6e5bcea55b (patch) | |
tree | 74b040532952493b56ceb110cb13d4b8ba55366c /generic/tclUtil.c | |
parent | 565bd04328ff6afd8e176982f12ae7e376db8f34 (diff) | |
download | tcl-e691fce6b050292abd74b38b28886b6e5bcea55b.zip tcl-e691fce6b050292abd74b38b28886b6e5bcea55b.tar.gz tcl-e691fce6b050292abd74b38b28886b6e5bcea55b.tar.bz2 |
* generic/tclInterp.c: Corrected bad syntax of Tcl_Panic() call.
* generic/tclUtil.c (TclGetProcessGlobalValue): More robust handling
of bad TclInitProcessGlobalValueProc behavior; an immediate panic
rather than a mysterious crash later.
* generic/tclEncoding.c: Several changes to the way the
encodingFileMap cache is maintained. Previously, it was attempted
to keep the file map filled and up to date with changes in the
encoding search path. This contributed to slow startup times since
it required an expensive "glob" operation to fill the cache. Now the
validity of items in the cache are checked at the time they are
used, so the cache is permitted to fall out of sync with the
encoding search path. Only [encoding names] and Tcl_GetEncodingNames()
now pay the full expense. [Bug 1177363]
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 9b7d0ec..16cee4b 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.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: tclUtil.c,v 1.54 2005/04/05 16:56:30 dgp Exp $ + * RCS: @(#) $Id: tclUtil.c,v 1.55 2005/04/12 20:28:48 dgp Exp $ */ #include "tclInt.h" @@ -2745,14 +2745,14 @@ TclGetProcessGlobalValue(pgvPtr) /* If no thread has set the shared value, call the initializer */ Tcl_MutexLock(&pgvPtr->mutex); - if (NULL == pgvPtr->value) { - if (pgvPtr->proc) { - pgvPtr->epoch++; - (*(pgvPtr->proc))(&pgvPtr->value, &pgvPtr->numBytes, - &pgvPtr->encoding); - Tcl_CreateExitHandler(FreeProcessGlobalValue, - (ClientData) pgvPtr); + if ((NULL == pgvPtr->value) && (pgvPtr->proc)) { + pgvPtr->epoch++; + (*(pgvPtr->proc))(&pgvPtr->value, &pgvPtr->numBytes, + &pgvPtr->encoding); + if (pgvPtr->value == NULL) { + Tcl_Panic("PGV Initializer did not initialize."); } + Tcl_CreateExitHandler(FreeProcessGlobalValue, (ClientData) pgvPtr); } /* Store a copy of the shared value in our epoch-indexed cache */ |