Previous

10.2. The standard prelude

{The declarations of the standard-prelude comprise "environment enquiries", which supply information concerning a specific property of the implementation {2.2.2.c }, "standard modes", "standard operators and functions", "synchronization operations" and "transput declarations" (which are given in section 10.3 ).}

10.2.4. Synchronization operations

The elaboration of a parallel-clause P {3.3.1.c } in an environ E is termed a "parallel action". The elaboration of a constituent unit of P in E is termed a "process" of that parallel action.

Any elaboration A {in some environ} of either of the ENCLOSED-clauses delineated by the pragmats {9.2.1.b } PR start of incompatible part PR and PR finish of incompatible part PR in the forms 10.2.4.d and 10.2.4.e is incompatible with {2.1.4.2.e } any elaboration B of either of those ENCLOSED-clauses if A and B are descendent actions {2.1.4.2.b } of different processes of some same parallel action.

a) MODE SEMA = STRUCT(REF INT {F}f);

b) OP LEVEL =(INT a)SEMA: (SEMA s; {F}f OF s := HEAP INT := a; s);

c) OP LEVEL =(SEMA a)INT: {F}f OF a;

d)

OP DOWN = (SEMA edsger) VOID:
BEGIN REF INT dijkstra = {F}fff OF edsger;
    WHILE
        PR start of incompatible part PR
        IF dijkstra >= 1 THEN dijkstra -:= 1; FALSE
        ELSE
            © let P be the process such that the elaboration
		of this pseudo-comment {10.1.3.Step 7
} is a descendent
		action of P, but not of any other process de scended from P;
		the process P is halted {2.1.4.3.f
} ©;
            TRUE
        FI
          PR finish of incompatible part PR
    DO SKIP OD
END;

e)

OP UP = (SEMA edsger) VOID:
  PR start of incompatible part PR
  IF REF INT dijkstra = {F}fff OF edsger; (dijkstra +:= 1) >= 1
  THEN
      © all processes are resumed {2.1.4.3.g
} which are halted because the i nteger referred to by the name yielded by 'dijkstra' was smaller than one ©
  FI
    PR finish of incompatible part PR;


 
Next