Process.mesa
Copyright Ó 1985, 1986, 1988, 1989, 1991 by Xerox Corporation. All rights reserved.
Carl Hauser, November 22, 1988 11:07:19 am PST
Process: CEDAR DEFINITIONS
= BEGIN
Initializing monitors and condition variables
ConditionPointer: TYPE = POINTER TO Condition;
Condition: TYPE = CONDITION; -- The builtin Cedar type; Structure is opaque.
MonitorPointer: TYPE = POINTER TO Monitor;
Monitor: TYPE = MONITORLOCK; -- The builtin Cedar type; Structure is opaque.
InitializeMonitor: UNSAFE PROC [monitor: MonitorPointer];
InitializeCondition: UNSAFE PROC [condition: ConditionPointer, ticks: Ticks];
Timeouts
Ticks: TYPE = CARD32;
Milliseconds: TYPE = CARD32;
Seconds: TYPE = CARD32;
MsecToTicks: PROC [Milliseconds] RETURNS [Ticks];
SecondsToTicks: PROC [Seconds] RETURNS [Ticks];
TicksToMsec: PROC [Ticks] RETURNS [Milliseconds];
Timeouts
SetTimeout: UNSAFE PROC [condition: ConditionPointer, ticks: Ticks];
DisableTimeout: UNSAFE PROC [condition: ConditionPointer];
Detaching processes
Detach: PROC [PROCESS];
Identity of the currently executing process
GetCurrent: PROC RETURNS [PROCESS];
Priorities of processes
Priority: TYPE = CARD32;
priorityIdleProcess: Priority = 0;
priorityBackground, priorityClient0: Priority = 1;
priorityNormal, priorityClient1: Priority = 2;
priorityForeground, priorityClient2: Priority = 3;
priorityClient3: Priority = 4;
priorityFaultHandlers: Priority = 5;
priorityRealTime: Priority = 6;
prioritySwatWatcher: Priority = 7;
priorityLast: Priority = 7;
SetPriority: PROC [p: Priority];
GetPriority: PROC RETURNS [Priority];
Aborts
Abort: PROC [PROCESS];
Requests that the indicated process be aborted.
CancelAbort: PROC [PROCESS];
The process won't subsequently be aborted for any preceding Abort request.
AbortPending: PROC [] RETURNS [abortPending: BOOLEAN];
Inquire as to abort requests for current process.
CheckForAbort: PROC;
Checks for the current process being asked to abort by Abort. Raises ABORTED and cancels the request. Otherwise CheckForAbort is a null operation.
DisableAborts: UNSAFE PROC [pCondition: ConditionPointer];
EnableAborts: UNSAFE PROC [pCondition: ConditionPointer];
Control of Scheduling
Pause: PROC [ticks: Ticks];
PauseMsec: PROC [ms: Milliseconds];
Yield: PROC;
Process validation
ValidateProcess: PROC [PROCESS];
InvalidProcess: READONLY ERROR [process: PROCESS];
END.
CHauser, February 21, 1989: Added CancelAbort.
CHauser, March 1, 1989: Changed type of Monitor from opaque to MONITORLOCK;