Oberon || Library || Module Index || Search Engine || Definition || Module
TYPE Condition = POINTER TO ConditionRec; TYPE ConditionRec = RECORD (Conditions.ConditionRec) END; PROCEDURE Create(VAR condition: Conditions.Condition; clock: Clocks.Clock; time: Times.Time); PROCEDURE Init(condition: Condition; clock: Clocks.Clock; time: Times.Time);
Create creates and returns condition which evaluates to TRUE if the current time of clock is greater than or equal to time. Relative time measures are interpreted relative to the current time of the given clock at creation of the time condition. Once a time condition becomes true for the first time, it remains true even if the clock has been set back afterwards.
In case of an extended type of Condition, Init can be used instead of Create.
PROCEDURE Delay(seconds: INTEGER); VAR time: Times.Time; condition: Conditions.Condition; BEGIN Times.CreateAndSet(time, Times.relative, 0, seconds, 0); TimeConditions.Create(condition, Clocks.system, time); Tasks.WaitFor(condition); END Delay;
Oberon || Library || Module Index || Search Engine || Definition || Module