DocAda(tm) is a productivity tool of KSCE

Prev | Up | Next | Back | Forward
About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News

D.5 Dynamic Priorities

This clause specifies how the base priority of a task can be modified or queried at run time.

Static Semantics

The following language-defined library package exists:

   
       with System;
       with Ada.Task_Identification; -- See C.7.1
       package Ada.Dynamic_Priorities is

           procedure Set_Priority(Priority : in System.Any_Priority;
                                               T : in Ada.Task_Identification.Task_ID :=
                                               Ada.Task_Identification.Current_Task);

           function Get_Priority (T : Ada.Task_Identification.Task_ID :=
                                               Ada.Task_Identification.Current_Task)
                                               return System.Any_Priority;

       end Ada.Dynamic_Priorities;

Dynamic Semantics

The procedure Set_Priority sets the base priority of the specified task to the specified Priority value. Set_Priority has no effect if the task is terminated.

The function Get_Priority returns T's current base priority. Tasking_Error is raised if the task is terminated.

Program_Error is raised by Set_Priority and Get_Priority if T is equal to Null_Task_ID.

Setting the task's base priority to the new value takes place as soon as is practical but not while the task is performing a protected action. This setting occurs no later then the next abort completion point of the task T (see 9.8).

Bounded (Run-Time) Errors

If a task is blocked on a protected entry call, and the call is queued, it is a bounded error to raise its base priority above the ceiling priority of the corresponding protected object. When an entry call is cancelled, it is a bounded error if the priority of the calling task is higher than the ceiling priority of the corresponding protected object. In either of these cases, either Program_Error is raised in the task that called the entry, or its priority is temporarily lowered, or both, or neither.

Erroneous Execution

If any subprogram in this package is called with a parameter T that specifies a task object that no longer exists, the execution of the program is erroneous.

Metrics

The implementation shall document the following metric:

About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News
Prev | Up | Next | Back | Forward


Copyright © 1994-1997 by Kempe Software Capital Enterprises. All Rights Reserved. For comments on this DocAda(tm) hypertext document, please write to KSCE, at docada@ksce.com