EndOpsImpl.mesa; Written by D. Wyatt
Last Edited by: Wyatt, October 14, 1983 7:04 pm
DIRECTORY
EndOps USING [];
EndOpsImpl: CEDAR MONITOR
EXPORTS EndOps
= BEGIN
Procedures registered will be called synchronously after the user input is enabled, but before any automatic checkpoint takes place.
ProcList: TYPE = LIST OF PROC;
registerList, registerTail: ProcList ← NIL;
Register:
PUBLIC
ENTRY
PROC[proc:
PROC] = {
prev: ProcList = registerTail;
registerTail ← LIST[proc];
IF prev=NIL THEN registerList ← registerTail
ELSE prev.rest ← registerTail;
};
GetList:
ENTRY
PROC
RETURNS[ProcList] = {
list: ProcList = registerList;
registerList ← registerTail ← NIL; -- flush registry now that we're done with it
RETURN[list];
};
ProcessRegistry:
PUBLIC
PROC = {
FOR l: ProcList ← GetList[], l.rest
UNTIL l=
NIL
DO
proc: PROC = l.first;
proc[! ANY => CONTINUE];
ENDLOOP;
};