-- Process.mesa (last edited by: Sandman on: June 30, 1980  11:38 AM) --
-- Copyright  Xerox Corporation 1979, 1980

Process: DEFINITIONS =
  BEGIN

  --Initializing monitors and condition variables 

  InitializeMonitor: PROCEDURE [monitor: --LONG--POINTER TO MONITORLOCK];
  InitializeCondition: PROCEDURE [
    condition: --LONG--POINTER TO CONDITION, ticks: Ticks];
  Ticks: TYPE = CARDINAL;
  Milliseconds: TYPE = CARDINAL;
  Seconds: TYPE = CARDINAL;
  MsecToTicks: PROCEDURE [Milliseconds] RETURNS [Ticks];
  SecondsToTicks: PROCEDURE [Seconds] RETURNS [Ticks];
  TicksToMsec: PROCEDURE [Ticks] RETURNS [Milliseconds];

  --Timeouts

  SetTimeout: PROCEDURE [condition: --LONG--POINTER TO CONDITION, ticks: Ticks];
  DisableTimeout: PROCEDURE [ --LONG--POINTER TO CONDITION];

  --Detaching processes

  Detach: PROCEDURE [PROCESS];

  --Identity of the currently executing process

  GetCurrent: PROCEDURE RETURNS [PROCESS];

  --Priorities of processes

  SetPriority: PROCEDURE [Priority];
  GetPriority: PROCEDURE RETURNS [Priority];
  Priority: TYPE = [0..7];

  --Aborting a process

  Abort: PROCEDURE [UNSPECIFIED]; --parameter should be any process

  DisableAborts: PROCEDURE [LONG POINTER TO CONDITION];

  --Control of Scheduling

  Pause: PROCEDURE [ticks: Ticks];
  Yield: PROCEDURE;

  --Process validation

  ValidateProcess: PROCEDURE [UNSPECIFIED];
  InvalidProcess: ERROR [process: UNSPECIFIED];

  --Signals and errors generated by the Process machinery

  Aborted: ERROR = LOOPHOLE[5B]; -- ABORTED

  TooManyProcesses: ERROR;

  END.