diff options
| author | davidg <davidg> | 2000-11-02 23:34:34 (GMT) |
|---|---|---|
| committer | davidg <davidg> | 2000-11-02 23:34:34 (GMT) |
| commit | cee59bb32c8eb0bcef6418108ba0fc9cd58f2bb8 (patch) | |
| tree | fad5ddefb37c8c815d3224dd1a8e2ce6471c0c5e /generic/tclEvent.c | |
| parent | 70703d0c59c3c89d8801eb193a4c40f046bf1952 (diff) | |
| download | tcl-cee59bb32c8eb0bcef6418108ba0fc9cd58f2bb8.zip tcl-cee59bb32c8eb0bcef6418108ba0fc9cd58f2bb8.tar.gz tcl-cee59bb32c8eb0bcef6418108ba0fc9cd58f2bb8.tar.bz2 | |
Added some more comments and a missing Tcl_IncrRefCount in
TclGetLibraryPath() when the tclLibraryPath Tcl_Obj needs to be
created.
Diffstat (limited to 'generic/tclEvent.c')
| -rw-r--r-- | generic/tclEvent.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c index b6715b3..2fff780 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.9 2000/11/02 22:04:54 davidg Exp $ + * RCS: @(#) $Id: tclEvent.c,v 1.10 2000/11/02 23:34:34 davidg Exp $ */ #include "tclInt.h" @@ -601,6 +601,11 @@ TclSetLibraryPath(pathPtr) Tcl_DecrRefCount(tsdPtr->tclLibraryPath); } tsdPtr->tclLibraryPath = pathPtr; + + /* + * No mutex locking is needed here as up the stack we're within + * TclpInitLock(). + */ tclLibraryPathStr = Tcl_GetStringFromObj(pathPtr, NULL); } @@ -627,7 +632,14 @@ TclGetLibraryPath() ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (tsdPtr->tclLibraryPath == NULL) { + /* + * Grab the shared string and place it into a new thread specific + * Tcl_Obj. + */ tsdPtr->tclLibraryPath = Tcl_NewStringObj(tclLibraryPathStr, -1); + + /* take ownership */ + Tcl_IncrRefCount(tsdPtr->tclLibraryPath); } return tsdPtr->tclLibraryPath; } |
