diff options
| author | dgp@users.sourceforge.net <dgp> | 2012-04-17 13:49:46 (GMT) |
|---|---|---|
| committer | dgp@users.sourceforge.net <dgp> | 2012-04-17 13:49:46 (GMT) |
| commit | 7ed34e9c5151fbe3751be1ea9d48d511e346ce66 (patch) | |
| tree | 8455e28435ac778476275eb1dd293cc9d8f59fe7 /generic/tclBasic.c | |
| parent | 2cd4d6b3b669e45f4dd4de0f95447afa2c75e100 (diff) | |
| download | tcl-7ed34e9c5151fbe3751be1ea9d48d511e346ce66.zip tcl-7ed34e9c5151fbe3751be1ea9d48d511e346ce66.tar.gz tcl-7ed34e9c5151fbe3751be1ea9d48d511e346ce66.tar.bz2 | |
Restore the tcl_platform(threaded) variable.
Diffstat (limited to 'generic/tclBasic.c')
| -rw-r--r-- | generic/tclBasic.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 21fb2e2..e09ea1e 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -928,6 +928,17 @@ Tcl_CreateInterp(void) TclPrecTraceProc, 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. * TIP #268: Full patchlevel instead of just major.minor |
