-- 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, Reactivate];
 
StayAlive: PROGRAM
  IMPORTS Process, Watchdog =
  BEGIN
  
  StayAlive: PUBLIC PROCEDURE =
    BEGIN
    oneHalfMinute: Process.Ticks = Process.SecondsToTicks[30];
    Process.SetPriority[Process.priorityBackground];
    Watchdog.Activate[3*60];
    DO
      Process.Pause[oneHalfMinute];
      Watchdog.Reactivate[3*60];
      ENDLOOP;
    END;
        
  Process.Detach[FORK StayAlive[]];
-- Watchdog.Deactivate[];

  END..