summaryrefslogtreecommitdiffstats
path: root/generic/tclEvent.c
diff options
context:
space:
mode:
authordavidg <davidg>2000-11-02 22:04:54 (GMT)
committerdavidg <davidg>2000-11-02 22:04:54 (GMT)
commit8bbd965fdceb67c1ac72e46c7917d09121c43db1 (patch)
tree31de454a2800d7d9a29ddcae3566cc32070b939f /generic/tclEvent.c
parent98584ab2ea17c1e5be3b498b6293689a2b09b853 (diff)
downloadtcl-8bbd965fdceb67c1ac72e46c7917d09121c43db1.zip
tcl-8bbd965fdceb67c1ac72e46c7917d09121c43db1.tar.gz
tcl-8bbd965fdceb67c1ac72e46c7917d09121c43db1.tar.bz2
2000-11-02 David Gravereaux <davygrvy@ajubasolutions.com>
* generic/tclEvent.c: tclLibraryPath Tcl_Obj didn't have a way to share its data among threads. This caused Tcl_Init() to always fail in threads. Added a way to pass the data around with a global char*. [BUG: 5301]
Diffstat (limited to 'generic/tclEvent.c')
-rw-r--r--generic/tclEvent.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index ce43e94..b6715b3 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.8 2000/04/18 23:10:04 hobbs Exp $
+ * RCS: @(#) $Id: tclEvent.c,v 1.9 2000/11/02 22:04:54 davidg Exp $
*/
#include "tclInt.h"
@@ -99,6 +99,11 @@ typedef struct ThreadSpecificData {
static Tcl_ThreadDataKey dataKey;
/*
+ * Common string for the library path for sharing across threads.
+ */
+char *tclLibraryPathStr;
+
+/*
* Prototypes for procedures referenced only in this file:
*/
@@ -596,6 +601,7 @@ TclSetLibraryPath(pathPtr)
Tcl_DecrRefCount(tsdPtr->tclLibraryPath);
}
tsdPtr->tclLibraryPath = pathPtr;
+ tclLibraryPathStr = Tcl_GetStringFromObj(pathPtr, NULL);
}
/*
@@ -619,6 +625,10 @@ Tcl_Obj *
TclGetLibraryPath()
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ if (tsdPtr->tclLibraryPath == NULL) {
+ tsdPtr->tclLibraryPath = Tcl_NewStringObj(tclLibraryPathStr, -1);
+ }
return tsdPtr->tclLibraryPath;
}