PLAOpsTimeOut.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Last edited by Curry, September 23, 1984 11:53:37 am PDT
DIRECTORY
PLAOps,
Process;
PLAOpsTimeOut: CEDAR MONITOR
IMPORTS PLAOps, Process EXPORTS PLAOps =
BEGIN
mode: {off, on, reset, quit} ← off;
checkMode: CONDITION;
TimeOut: PUBLIC ENTRY PROC[minutes: CARDINAL] = {
mode ← off;
IF minutes > 177777B/60 THEN RETURN;
TRUSTED {
Process.SetTimeout[@checkMode, Process.SecondsToTicks[minutes*60]];
Process.SetPriority[Process.priorityNormal]};
WHILE mode=off DO
WAIT checkMode ENDLOOP;
WHILE mode=on OR mode=reset DO
WAIT checkMode;
SELECT mode FROM
reset => {mode←on; LOOP};
on  => {mode←quit; PLAOps.FinishMin ← TRUE};
ENDCASE; EXIT ENDLOOP };
TimeOutReset: PUBLIC ENTRY PROC = {
mode ← reset;
NOTIFY checkMode };
TimeOutQuit: PUBLIC ENTRY PROC = {
mode ← quit;
NOTIFY checkMode };
END.