DIRECTORY Finalize USING [FinalizationState, Handle], Process USING [Priority, priorityForeground]; FinalizeOps: CEDAR DEFINITIONS ~ BEGIN Handle: TYPE = Finalize.Handle; IsFinalizeOpsHandle: PROC [handle: Finalize.Handle] RETURNS [BOOL]; FinalizeProc: TYPE = PROC [handle: Handle, object: REF]; CallQueue: TYPE = REF CallQueueRep; CallQueueRep: TYPE; IsCallQueue: PROC [x: REF] RETURNS [BOOL]; NarrowCallQueue: PROC [x: REF] RETURNS [CallQueue]; EnableFinalization: PROC [object: REF, callQueue: CallQueue] RETURNS [handle: Handle]; ReenableFinalization: PROC [handle: Handle] RETURNS [oldState: Finalize.FinalizationState]; CreateCallQueue: PROC [finalize: FinalizeProc, priority: Process.Priority ¬ Process.priorityForeground] RETURNS [CallQueue]; END. ϊ FinalizeOps.mesa Copyright Σ 1992 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, July 17, 1992 1:45:01 pm PDT Christian Jacobi, July 22, 1992 10:44 am PDT Access to Finalize using fewer resources. All FinalizeOps clients are sharing a single Finalize.FinalizationQueue. Threads are allocated only while needed. A "disguised" REF to an object Compatible with Finalize.Handle, except: The clientData field is used by FinalizeOpsImpl; it is not useful for clients of FinalizeOps. Returns whether handle has been created with FinalizeOps Type for procedure called to do finalization on handle. object is Finalize.HandleToObject[handle], pre-computed for conveniance. Represents a queue, thread, and a FinalizeProc procedure removing objects from the queue and finalizing them. Like ISTYPE[x, CallQueue] Like NARROW[x, CallQueue] Register object for finalization, returning a handle in enabled state. Reenable finalization for handle, returning its previous finalization state. If handle was on the FinalizationQueue but not yet in the CallQueue, this removes it from the FinalizationQueue. oldState = disabled would not reflect whether a FinalizeProc has already been called or not. Clients which need this information reliably must keep track of it themselves in the FinalizeProc (and use a monitor of their own). Restriction: handle must have been created with FinalizeOps.EnableFinalization. Creates a new queue; "finalize" will be called using "priority" to finalize objects. Κ½•NewlineDelimiter –(cedarcode) style™code™Kšœ Οeœ1™