DIRECTORY Process, SlackProcess, SlackProcessTypes; SlackProcessExtras: CEDAR DEFINITIONS = BEGIN ActionProc: TYPE = SlackProcess.ActionProc; SlackHandle: TYPE = SlackProcess.SlackHandle; Pause: PROC [handle: SlackHandle]; Continue: PROC [handle: SlackHandle]; PauseRequested: PROC [handle: SlackHandle] RETURNS [BOOL]; ProcessIsBusy: PROC [handle: SlackHandle] RETURNS [BOOL]; HasPaused: PROC [handle: SlackHandle] RETURNS [BOOL] = INLINE { RETURN[PauseRequested[handle] AND (NOT ProcessIsBusy[handle])]; }; WaitUntilPaused: PROC [handle: SlackHandle, timeoutTicks: Process.Ticks _ LAST[CARD32]] RETURNS [success: BOOL _ TRUE]; ProcessState: TYPE = {paused, idle, timeout}; WaitUntilPausedOrIdle: PROC [handle: SlackHandle, timeoutTicks: Process.Ticks _ LAST[CARD32]] RETURNS [state: ProcessState]; QueueReadOnly: PROC [handle: SlackHandle, callBack: ActionProc, inputAction: REF, clientData: REF, optimizeHint: REF, priority: Process.Priority _ LAST[CARD32]]; QueueOrTimeout: PROC [handle: SlackHandle, callBack: ActionProc, inputAction: REF, clientData: REF, optimizeHint: REF, timeoutTicks: Process.Ticks, priority: Process.Priority _ LAST[CARD32]] RETURNS [success: BOOL _ TRUE]; AllQueuedAreReadOnly: PROC [handle: SlackHandle] RETURNS [BOOL]; InspectProc: TYPE = PROC [qeGen: SlackProcessTypes.QueueEntryGenerator, actionsOnQueue: NAT]; InspectQueue: PROC [handle: SlackHandle, inspectProc: InspectProc]; END. φ SlackProcessExtras.mesa Copyright c 1990 by Xerox Corporation. All rights reserved. Bier, April 3, 1991 4:52 pm PST Contents: Routines for finer control of the process that dequeues and executes actions. Request that the dequeuing process stop as soon as it has finished its current action (if any). Cancels a pause request, allowing the dequeuing process to resume processing actions. Returns TRUE if Pause has been called on this handle since the last Create or Continue was performed on this handle. RETURNS TRUE if the dequeuing process associated with handle is currently active. Causes the calling process to wait on a condition variable until the dequeuing process has stopped processing actions. If no pause has been requested, we wait anyway hoping another process will request one. If timeoutTicks = LAST[CARD32], always waits for the pause. Otherwise, if no pause occurs in timeoutTicks ticks, returns success = FALSE. Causes the calling process to wait on a condition variable until the dequeuing process has stopped processing actions. If timeoutTicks = LAST[CARD32], always waits for pause or idle. Otherwise, if no pause or idle occurs in timeoutTicks ticks, returns state = timeout. Like SlackProcess.QueueAction but marks this action as one that will only read data structures, not modify them. Like SlackProcess.QueueAction, but includes a timeout. If the action cannot be queued within this time period, the routine returns success = FALSE. Returns TRUE if all currently queued actions (including the currently active action, if any) were queued using QueueReadOnly. Gives client a chance to inspect the queue at a time other than when the slack process is trying to decide what to do next (i.e., an InspectProc is much like an OptimizeProc). ΚY•NewlineDelimiter ™Icodešœ™Kšœ Οmœ1™