-- Copyright (C) 1983  by Xerox Corporation. All rights reserved. 
-- StayAlive.mesa, HGM, 20-Nov-83 19:30:40
-- Tim Diebert,  6-Nov-85  8:10:21

DIRECTORY
  Process USING [Detach, Pause, priorityBackground, SecondsToTicks, SetPriority, Ticks],
  Watchdog USING [Activate, Deactivate, Reactivate];
 
StayAlive: PROGRAM
  IMPORTS Process, Watchdog =
  BEGIN
  
  StayAlive: PUBLIC PROCEDURE =
    BEGIN
    oneMinute: Process.Ticks = Process.SecondsToTicks[60];
    Process.SetPriority[Process.priorityBackground];
    Watchdog.Activate[2*60];
    DO
      Process.Pause[oneMinute];
      Watchdog.Reactivate[2*60];
      ENDLOOP;
    END;
        
--  Process.Detach[FORK StayAlive[]];
Watchdog.Deactivate[];

  END..