-- RTQueue.Mesa
-- last edited May 12, 1983 5:33 pm by Paul Rovner

RTQueue: DEFINITIONS = BEGIN

-- Types

Q: TYPE = RECORD[REF ANY];
qNil: Q = [NIL];

-- Procedures

New: PROCEDURE[nRefs: CARDINAL ← 10] RETURNS[Q];
Enqueue: PROCEDURE[ref: REF ANY, q: Q] RETURNS[full: BOOLEAN]; -- called only by the collector
Dequeue: PROCEDURE[q: Q] RETURNS[ref: REF ANY]; -- WAITs if queue is empty
Empty: PROCEDURE[q: Q] RETURNS[BOOLEAN];

END.