Oberon || Library || Module Index || Search Engine || Definition || Module
TYPE Condition = POINTER TO ConditionRec; TYPE ConditionRec = RECORD (Conditions.ConditionRec) END;
CONST noRoot = 0; invalidPath = 1; serverFailure = 2; CONST accessFailed = 3; termination = 4; CONST errors = 5; TYPE ErrorCode = SHORTINT; TYPE ErrorEvent = POINTER TO ErrorEventRec; TYPE ErrorEventRec = RECORD (Events.EventRec) errorcode: ErrorCode; END; VAR error: Events.EventType; VAR errormsg: ARRAY errors OF Events.Message;
PROCEDURE Create(VAR cond: Condition; path: ARRAY OF CHAR; root: Names.Node; auth: Shards.Lid); PROCEDURE CreateCS(VAR cond: Condition; path: ConstStrings.String; root: Names.Node; auth: Shards.Lid); PROCEDURE GetNode(cond: Condition; VAR node: Names.Node; errors: RelatedEvents.Object) : BOOLEAN;
Create and CreateCS create a condition which evaluates to TRUE when path (taken relatively to root) becomes accessible or a fatal error occurs (see below). The authorization lid auth is passed to all operations of Names, namely Names.GetNode and Names.TakeInterest. Note that this condition cannot be recycled, i.e. if it once becomes TRUE, it remains TRUE.
Please note that all conditions by PathConditions are aborted if the process terminates, i.e. if Process.termination or Process.softTermination is raised. This allows the tasks associated with each condition to terminate as well.
GetNode waits for cond becoming TRUE (if this has not been done already), and returns on success the node, or, in case of fatal errors, relates all error events to errors.
PathConditions expects from all implementations of Names with domain capability that terminated objects (see Resources) vanish automatically together with the correct generation of member events if requested to do so. Otherwise, the conditions of PathConditions may hang longer than expected.
Oberon || Library || Module Index || Search Engine || Definition || Module