summaryrefslogtreecommitdiffstats
path: root/generic/tclEvent.c
diff options
context:
space:
mode:
authordavidg <davidg@noemail.net>2000-11-02 22:04:54 (GMT)
committerdavidg <davidg@noemail.net>2000-11-02 22:04:54 (GMT)
commit129b68882176dc6255303f1a213ec672c5f53878 (patch)
tree31de454a2800d7d9a29ddcae3566cc32070b939f /generic/tclEvent.c
parentc12c4b90514150811650ce67565e6cbc9b059347 (diff)
downloadtcl-129b68882176dc6255303f1a213ec672c5f53878.zip
tcl-129b68882176dc6255303f1a213ec672c5f53878.tar.gz
tcl-129b68882176dc6255303f1a213ec672c5f53878.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] FossilOrigin-Name: 5584667c8ff1f62fbfa0a65c1350de18093a6e43
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;
}