summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsurles <surles>1999-05-14 23:16:54 (GMT)
committersurles <surles>1999-05-14 23:16:54 (GMT)
commitc4e326675c4755672637659f2cdc844048de4cf9 (patch)
tree0174c7f979f178be8541abeafd70f2c96380bf7f
parent489a58b5fc11bc30a2f91ed570afc77917e9b1c0 (diff)
downloadtcl-c4e326675c4755672637659f2cdc844048de4cf9.zip
tcl-c4e326675c4755672637659f2cdc844048de4cf9.tar.gz
tcl-c4e326675c4755672637659f2cdc844048de4cf9.tar.bz2
added intospection variable to determine if the interp was compiled with threads enabled
-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.
*/