-- we settled on the present compromise. Things we do not like about
-- this implementation include:
--- - It is vulnerable to bad Task_ID values, to the extent of
+-- - It is vulnerable to bad Task_Id values, to the extent of
-- possibly trashing memory and crashing the runtime system.
-- - It requires dynamic storage allocation for each new attribute value,
with Ada.Task_Identification;
-- used for Task_Id
--- Null_Task_ID
+-- Null_Task_Id
-- Current_Task
with System.Error_Reporting;
with System.Tasking;
-- used for Access_Address
--- Task_ID
+-- Task_Id
-- Direct_Index_Vector
-- Direct_Index
(Access_Wrapper, Access_Dummy_Wrapper);
-- To store pointer to actual wrapper of attribute node
- function To_Task_ID is new Unchecked_Conversion
- (Task_Identification.Task_Id, Task_ID);
+ function To_Task_Id is new Unchecked_Conversion
+ (Task_Identification.Task_Id, Task_Id);
-- To access TCB of identified task
type Local_Deallocator is access procedure (P : in out Access_Node);
(T : Task_Identification.Task_Id := Task_Identification.Current_Task)
return Attribute_Handle
is
- TT : Task_ID := To_Task_ID (T);
- Error_Message : constant String := "Trying to get the reference of a ";
+ TT : constant Task_Id := To_Task_Id (T);
+ Error_Message : constant String := "Trying to get the reference of a ";
begin
if TT = null then
procedure Reinitialize
(T : Task_Identification.Task_Id := Task_Identification.Current_Task)
is
- TT : Task_ID := To_Task_ID (T);
- Error_Message : constant String := "Trying to Reinitialize a ";
+ TT : constant Task_Id := To_Task_Id (T);
+ Error_Message : constant String := "Trying to Reinitialize a ";
begin
if TT = null then
(Val : Attribute;
T : Task_Identification.Task_Id := Task_Identification.Current_Task)
is
- TT : Task_ID := To_Task_ID (T);
- Error_Message : constant String := "Trying to Set the Value of a ";
+ TT : constant Task_Id := To_Task_Id (T);
+ Error_Message : constant String := "Trying to Set the Value of a ";
begin
if TT = null then
-----------
function Value
- (T : Task_Identification.Task_Id := Task_Identification.Current_Task)
+ (T : Task_Identification.Task_Id := Task_Identification.Current_Task)
return Attribute
is
- TT : Task_ID := To_Task_ID (T);
- Error_Message : constant String := "Trying to get the Value of a ";
+ TT : constant Task_Id := To_Task_Id (T);
+ Error_Message : constant String := "Trying to get the Value of a ";
begin
if TT = null then
-- Initialize the attribute, for all tasks.
declare
- C : System.Tasking.Task_ID := System.Tasking.All_Tasks_List;
+ C : System.Tasking.Task_Id := System.Tasking.All_Tasks_List;
begin
while C /= null loop
C.Direct_Attributes (Local.Index) :=