diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-12-05 21:38:47 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-12-05 21:38:47 (GMT) |
commit | 0ab0d532e146a573c487c7e5e4c66282136b7b57 (patch) | |
tree | c207c5d068a3f8ce9acde9a101534b8e67958256 /doc/CrtInterp.3 | |
parent | 4efb1a0f47c957eb324a55b4e51e7a4207002aa1 (diff) | |
download | tcl-0ab0d532e146a573c487c7e5e4c66282136b7b57.zip tcl-0ab0d532e146a573c487c7e5e4c66282136b7b57.tar.gz tcl-0ab0d532e146a573c487c7e5e4c66282136b7b57.tar.bz2 |
Implement TIP#335
Diffstat (limited to 'doc/CrtInterp.3')
-rw-r--r-- | doc/CrtInterp.3 | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/doc/CrtInterp.3 b/doc/CrtInterp.3 index 14679a6..d751f75 100644 --- a/doc/CrtInterp.3 +++ b/doc/CrtInterp.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtInterp.3,v 1.8 2008/07/08 12:34:58 dkf Exp $ +'\" RCS: @(#) $Id: CrtInterp.3,v 1.9 2008/12/05 21:38:47 dkf Exp $ '\" .so man.macros .TH Tcl_CreateInterp 3 7.5 Tcl "Tcl Library Procedures" @@ -23,10 +23,15 @@ Tcl_Interp * .sp int \fBTcl_InterpDeleted\fR(\fIinterp\fR) +.sp +.VS 8.6 +int +\fBTcl_InterpActive\fR(\fIinterp\fR) +.VE 8.6 .SH ARGUMENTS .AS Tcl_Interp *interp .AP Tcl_Interp *interp in -Token for interpreter to be destroyed. +Token for interpreter to be destroyed or queried. .BE .SH DESCRIPTION .PP @@ -65,6 +70,15 @@ between when only the memory the callback is responsible for is being deleted and when the whole interpreter is being deleted. In the former case the callback may recreate the data being deleted, but this would lead to an infinite loop if the interpreter were being deleted. +.PP +.VS 8.6 +\fBTcl_InterpActive\fR is useful for determining whether there is any +execution of scripts ongoing in an interpreter, which is a useful piece of +information when Tcl is embedded in a garbage-collected environment and it +becomes necessary to determine whether the interpreter is a candidate for +deletion. The function returns a true value if the interpreter has at least +one active execution running inside it, and a false value otherwise. +.VE 8.6 .SH "INTERPRETERS AND MEMORY MANAGEMENT" .PP \fBTcl_DeleteInterp\fR can be called at any time on an interpreter that may @@ -124,6 +138,13 @@ reused. All uses of interpreters in Tcl and Tk have already been protected. Extension writers should ensure that their code also properly protects any additional interpreters used, as described above. +.PP +.VS 8.6 +Note that the protection mechanisms do not work well with conventional garbage +collection systems. When in such a managed environment, \fBTcl_InterpActive\fR +should be used to determine when an interpreter is a candidate for deletion +due to inactivity. +.VE 8.6 .SH "SEE ALSO" Tcl_Preserve(3), Tcl_Release(3) .SH KEYWORDS |