3.2. Additional Predefined Packages

Programs that are not restricted to the Ravenscar Profile may also use the predefined packages Ada.Asynchronous_Task_Control, Ada.Dynamic_Priorities, Ada.Synchronous_Task_Control and Ada.Task_Identification.

The function Current_Task allows a task to get an identifier for itself. This identifier may then be used in calls the the subprograms in Ada.Asynchronous_Task_Control, which allow a task to be placed on hold, or to continue. Tasks that are on hold consume no CPU time but do retain their state.

The package Ada.Task_Identification allows a task to be aborted. In ERC32 Ada this places the task in a state from which it may be restarted using the subprograms in XGC.Tasking.Stages.

The base priority of any task (including the current task) may be requested or changed using the package Ada.Dynamic_Priorities. Note that if you change the priority of the current task within a protected operation then it is the base priority that changes: the active priority inherited from the protect object does not change. When the active priority is set back to the base priority is when the change takes effect.