"Fossies" - the Fresh Open Source Software archive

Member "jacl1.4.1/docs/TclJava/JavaLockCmd.html" (25 Jan 2000, 1209 Bytes) of archive /linux/misc/jacl1.4.1.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted source code. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.


The java::lock Command


Usage:

java::lock javaObj

The java::lock command prevents the Java object, javaObj, from getting garbage collected. A Tcl variable that stores a Java object handle has an internal rep that holds a reference to the Java object. If the Tcl variable's internal rep is changed (e.g. to a Tcl List), the reference to the Java object is removed, and the Java object could be garbage collected. The java::lock command maintains a copy of javaObj's internal rep, so the Java object will be not be garbage collected. Multiple locks can be placed on the same Java object. If javaObject is not a valid reference to a Java object, a Tcl error is generated. It is important to note that use of the java::lock command is optional, it is not required. A Java object handle that is stored in a Tcl variable will not be garbage collected unless the Tcl variable is unset, or the internal representation is changed.

Copyright © 1997-1998 Sun Microsystems, Inc.