From c2e90ea6af2571fcf719c01d5d42ea8c8d1b5960 Mon Sep 17 00:00:00 2001 From: davidg Date: Thu, 2 Nov 2000 23:34:34 +0000 Subject: Added some more comments and a missing Tcl_IncrRefCount in TclGetLibraryPath() when the tclLibraryPath Tcl_Obj needs to be created. --- generic/tclEvent.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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; } -- cgit v0.12