Contents   Index   Search   Related Documents   Previous   Next


D.5.2 Dynamic Priorities for Protected Objects

1/2
     This clause specifies how the priority of a protected object can be modified or queried at run time.

Static Semantics

2/2
     The following attribute is defined for a prefix P that denotes a protected object:
3/2
     P'Priority
Denotes a non-aliased component of the protected object P. This component is of type System.Any_Priority and its value is the priority of P. A reference to this attribute shall appear only within the body of P.
4/2
     The initial value of this attribute is set by pragmas Priority or Interrupt_Priority, and can be changed by an assignment.

Dynamic Semantics

5/2
     If the locking policy Ceiling_Locking is in effect then the ceiling priority of a protected object P is set to the value of P'Priority at the end of each protected action of P.

Metrics

6/2
     The implementation shall document the following metric:
7/2
8/2
protected P is
   procedure Do_Not_Set_Ceiling (Pr : System.Any_Priority);
   procedure Set_Ceiling (Pr : System.Any_Priority);
private
   null;
end P;
9/2
protected body P is
   procedure Do_Not_Set_Ceiling (Pr : System.Any_Priority) is
   begin
      null;
   end;
   procedure Set_Ceiling (Pr : System.Any_Priority) is
   begin
      P'Priority := Pr;
   end;
end P;
NOTES
10/2
34  Since P'Priority is a normal variable, the value following an assignment to the attribute immediately reflects the new value even though its impact on the ceiling priority of P is postponed until completion of the protected action in which it is executed.

Contents   Index   Search   Related Documents   Previous   Next   Legal