else
declare
- P : Access_Node := To_Access_Node (TT.Indirect_Attributes);
- W : Access_Wrapper;
+ P : Access_Node := To_Access_Node (TT.Indirect_Attributes);
+ W : Access_Wrapper;
+ Self_Id : constant Task_Id := POP.Self;
begin
- Defer_Abortion;
+ Defer_Abort (Self_Id);
POP.Lock_RTS;
while P /= null loop
if P.Instance = Access_Instance'(Local'Unchecked_Access) then
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
return To_Access_Wrapper (P.Wrapper).Value'Access;
end if;
P.Next := To_Access_Node (TT.Indirect_Attributes);
TT.Indirect_Attributes := To_Access_Address (P);
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
return W.Value'Access;
exception
when others =>
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
raise;
end;
end if;
Set_Value (Initial_Value, T);
else
declare
- P, Q : Access_Node;
- W : Access_Wrapper;
+ P, Q : Access_Node;
+ W : Access_Wrapper;
+ Self_Id : constant Task_Id := POP.Self;
+
begin
- Defer_Abortion;
+ Defer_Abort (Self_Id);
POP.Lock_RTS;
Q := To_Access_Node (TT.Indirect_Attributes);
W := To_Access_Wrapper (Q.Wrapper);
Free (W);
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
return;
end if;
end loop;
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
exception
when others =>
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
raise;
end;
end if;
-- Not directly addressed
declare
- P : Access_Node := To_Access_Node (TT.Indirect_Attributes);
- W : Access_Wrapper;
+ P : Access_Node := To_Access_Node (TT.Indirect_Attributes);
+ W : Access_Wrapper;
+ Self_Id : constant Task_Id := POP.Self;
begin
- Defer_Abortion;
+ Defer_Abort (Self_Id);
POP.Lock_RTS;
while P /= null loop
if P.Instance = Access_Instance'(Local'Unchecked_Access) then
To_Access_Wrapper (P.Wrapper).Value := Val;
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
return;
end if;
TT.Indirect_Attributes := To_Access_Address (P);
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
exception
when others =>
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
raise;
end;
-- Not directly addressed
declare
- P : Access_Node;
- Result : Attribute;
+ P : Access_Node;
+ Result : Attribute;
+ Self_Id : constant Task_Id := POP.Self;
begin
- Defer_Abortion;
+ Defer_Abort (Self_Id);
POP.Lock_RTS;
P := To_Access_Node (TT.Indirect_Attributes);
if P.Instance = Access_Instance'(Local'Unchecked_Access) then
Result := To_Access_Wrapper (P.Wrapper).Value;
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
return Result;
end if;
end loop;
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
return Initial_Value;
exception
when others =>
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
raise;
end;
declare
Two_To_J : Direct_Index_Vector;
+ Self_Id : constant Task_Id := POP.Self;
begin
- Defer_Abortion;
+ Defer_Abort (Self_Id);
-- Need protection for updating links to per-task initialization and
-- finalization routines, in case some task is being created or
end if;
POP.Unlock_RTS;
- Undefer_Abortion;
+ Undefer_Abort (Self_Id);
end;
end Ada.Task_Attributes;
with Ada.Exceptions;
-- Used for Exception_Occurrence_Access
-with System.Tasking;
-pragma Elaborate_All (System.Tasking);
--- Ensure that the first step initializations have been performed
-
with System.Task_Primitives;
-- Used for Lock
-- Tasking versions of some services needed by non-tasking programs --
----------------------------------------------------------------------
+ procedure Abort_Defer;
+ -- NON-INLINE versions without Self_ID for soft links
+
+ procedure Abort_Undefer;
+ -- NON-INLINE versions without Self_ID for soft links
+
procedure Task_Lock;
-- Locks out other tasks. Preceding a section of code by Task_Lock and
-- following it by Task_Unlock creates a critical region. This is used
-- all nested locks must be released before other tasks competing for the
-- tasking lock are released.
- function Get_Exc_Stack_Addr return Address;
- -- Get the exception stack for the current task
-
- procedure Set_Exc_Stack_Addr (Self_ID : Address; Addr : Address);
- -- Self_ID is the Task_Id of the task that gets the exception stack.
- -- For Self_ID = Null_Address, the current task gets the exception stack.
-
function Get_Stack_Info return Stack_Checking.Stack_Access;
-- Get access to the current task's Stack_Info
Self_ID.Deferral_Level := Self_ID.Deferral_Level + 1;
end Defer_Abort_Nestable;
- --------------------
- -- Defer_Abortion --
- --------------------
+ -----------------
+ -- Abort_Defer --
+ -----------------
- procedure Defer_Abortion is
+ procedure Abort_Defer is
Self_ID : Task_Id;
-
begin
if No_Abort and then not Dynamic_Priority_Support then
return;
Self_ID := STPO.Self;
Self_ID.Deferral_Level := Self_ID.Deferral_Level + 1;
- end Defer_Abortion;
+ end Abort_Defer;
-----------------------
-- Do_Pending_Action --
procedure Init_RTS is
Self_Id : Task_Id;
-
begin
+ Tasking.Initialize;
+
-- Terminate run time (regular vs restricted) specific initialization
-- of the environment task.
-- the tasking version of the soft links can be used.
if not No_Abort or else Dynamic_Priority_Support then
- SSL.Abort_Defer := Defer_Abortion'Access;
- SSL.Abort_Undefer := Undefer_Abortion'Access;
+ SSL.Abort_Defer := Abort_Defer'Access;
+ SSL.Abort_Undefer := Abort_Undefer'Access;
end if;
SSL.Update_Exception := Update_Exception'Access;
SSL.Lock_Task := Task_Lock'Access;
SSL.Unlock_Task := Task_Unlock'Access;
- SSL.Get_Exc_Stack_Addr := Get_Exc_Stack_Addr'Access;
- SSL.Set_Exc_Stack_Addr := Set_Exc_Stack_Addr'Access;
SSL.Check_Abort_Status := Check_Abort_Status'Access;
SSL.Get_Stack_Info := Get_Stack_Info'Access;
SSL.Task_Name := Task_Name'Access;
- SSL.Set_Exc_Stack_Addr (Null_Address, SSL.Get_Exc_Stack_Addr_NT);
-
-- Initialize the tasking soft links (if not done yet) that are common
-- to the full and the restricted run times.
end if;
end Undefer_Abort_Nestable;
- ----------------------
- -- Undefer_Abortion --
- ----------------------
-
- -- Phase out RTS-internal use of Undefer_Abortion to reduce overhead due
- -- to multiple calls to Self.
+ -------------------
+ -- Abort_Undefer --
+ -------------------
- procedure Undefer_Abortion is
+ procedure Abort_Undefer is
Self_ID : Task_Id;
-
begin
if No_Abort and then not Dynamic_Priority_Support then
return;
Do_Pending_Action (Self_ID);
end if;
end if;
- end Undefer_Abortion;
+ end Abort_Undefer;
----------------------
-- Update_Exception --
-- Soft-Link Bodies --
----------------------
- function Get_Exc_Stack_Addr return Address is
- begin
- return STPO.Self.Common.Compiler_Data.Exc_Stack_Addr;
- end Get_Exc_Stack_Addr;
-
function Get_Stack_Info return Stack_Checking.Stack_Access is
begin
return STPO.Self.Common.Compiler_Data.Pri_Stack_Info'Access;
end Get_Stack_Info;
- procedure Set_Exc_Stack_Addr (Self_ID : Address; Addr : Address) is
- Me : Task_Id := To_Task_Id (Self_ID);
- begin
- if Me = Null_Task then
- Me := STPO.Self;
- end if;
-
- Me.Common.Compiler_Data.Exc_Stack_Addr := Addr;
- end Set_Exc_Stack_Addr;
-
-----------------------
-- Soft-Link Dummies --
-----------------------