Package org.armedbear.lisp.util
Class Finalizer
java.lang.Object
org.armedbear.lisp.util.Finalizer
Framework to monitor arbitrary objects to see if they have been
garbage collected, running one or more runnables when they have.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addFinalizer
(Object o, Runnable r) Schedules a Runnable to be run after garbage collection of the object.static void
Cancels any references scheduled to be run after garbage collection of the argument 'o'.
-
Constructor Details
-
Finalizer
public Finalizer()
-
-
Method Details
-
addFinalizer
Schedules a Runnable to be run after garbage collection of the object. Note that the Runnable can't contain references to the object to be collected: it will disable garbage collection of the object.- Parameters:
o
- The object to monitor for garbage collectionr
- The routine to be executed after GC-ing the object
-
clearFinalizers
Cancels any references scheduled to be run after garbage collection of the argument 'o'.- Parameters:
o
- Object to cancel references for
-