RefQueue.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Paul Rovner, August 2, 1983 7:11 pm
Russ Atkinson (RRA) February 1, 1985 12:40:37 pm PST
Beach, February 22, 1985 1:40:00 pm PST
Doug Wyatt, February 24, 1985 8:53:20 pm PST
A starving man's LIFO queue; Used to implement the Cedar object finalization mechanism
RefQueue: DEFINITIONS
= BEGIN
Queue: TYPE = REF Object;
Object: TYPE;
New: PROC[nEntries: NAT ← 100] RETURNS[Queue];
NO ALLOCATION is done by Enqueue, which is called by the collector
Enqueue: PROC[queue: Queue, ref: REF ANY] RETURNS[full: BOOL];
result TRUE => ref was not placed on queue
Dequeue: PROC[queue: Queue] RETURNS[ref: REF ANY];
WAITs if queue is empty
IsEmpty: PROC[queue: Queue] RETURNS[BOOL];
IsFull: PROC[queue: Queue] RETURNS[BOOL];
END.