D.5.2 Dynamic Priorities for Protected Objects
{
AI95-00327-01}
{
AI05-0299-1}
This subclause specifies how the priority of a protected object can be
modified or queried at run time.
Static Semantics
P'Priority
{
AI95-00327-01}
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. P'Priority
denotes a variable if and only if P denotes a variable. A reference to
this attribute shall appear only within the body of P.
P'Relative_Deadline
{
AI12-0230-1}
Denotes a non-aliased component of the protected object P. This component
is of type Ada.Real_Time.Time_Span and its value is the relative deadline
of P. P'Relative_Deadline denotes a variable if and only if P denotes
a variable. A reference to this attribute shall appear only within the
body of P.
{
AI95-00327-01}
{
AI12-0230-1}
The initial value of the attribute Priority is determined by the initial
value of the priority of the protected object (see
D.3)[,
and can be changed by an assignment]. The initial value of the attribute
Relative_Deadline is determined by the initial value of the relative
deadline of the protected object (see
D.3)[,
and can be changed by an assignment].
Dynamic Semantics
{
AI95-00327-01}
{
AI05-0264-1}
If the locking policy Ceiling_Locking (see
D.3)
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.
{
AI95-00445-01}
{
AI05-0229-1}
If the locking policy Ceiling_Locking is in effect, then for a protected
object
P with either an Attach_Handler or Interrupt_Handler aspect
specified for one of its procedures, a check is made that the value to
be assigned to
P'Priority is in the range System.Interrupt_Priority.
If the check fails, Program_Error is raised.
Metrics
{
AI95-00327-01}
The implementation shall document the following metric:
The difference in
execution time of calls to the following procedures in protected object
P:
protected P is
procedure Do_Not_Set_Ceiling (Pr : System.Any_Priority);
procedure Set_Ceiling (Pr : System.Any_Priority);
end P;
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;
Documentation Requirement: The metrics
for setting the priority of a protected object.
NOTE {
AI95-00327-01}
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.
Extensions to Ada 95
Extensions to Ada 2012
{
AI12-0230-1}
The ability to dynamically change and query the relative
deadline of a protected object is new.
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe