summaryrefslogtreecommitdiffstats
path: root/generic
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 /generic
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
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c15
1 files changed, 14 insertions, 1 deletions
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.
*/