summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclBasic.c15
2 files changed, 20 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c2ffe14..f2f9e7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-05-14 <surles@scriptics.com>
+
+ * generic/tclBasic.c (Tcl_CreateInterp): Added introspection
+ variable for threaded interps. If the interp was compiled with
+ threads enabled, the tcl_platform(threaded) variable will exist.
+
1999-05-14 <redman@scriptics.com>
* generic/tclDate.c: Applied patch to fix 100-year and 400-year
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 10d8311..8de3a0d 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.20 1999/05/13 01:50:32 stanton Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.21 1999/05/14 23:16:54 surles Exp $
*/
#include "tclInt.h"
@@ -529,6 +529,19 @@ Tcl_CreateInterp()
TclPrecTraceProc, (ClientData) NULL);
TclpSetVariables(interp);
+#ifdef TCL_THREADS
+ /*
+ * The existence of the "threaded" element of the tcl_platform array indicates
+ * that this particular Tcl shell has been compiled with threads turned on.
+ * Using "info exists tcl_platform(threaded)" a Tcl script can introspect on the
+ * interpreter level of thread safety.
+ */
+
+
+ Tcl_SetVar2(interp, "tcl_platform", "threaded", "1",
+ TCL_GLOBAL_ONLY);
+#endif
+
/*
* Register Tcl's version number.
*/