aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/s-taprop-posix.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/s-taprop-posix.adb')
-rw-r--r--gcc/ada/s-taprop-posix.adb74
1 files changed, 24 insertions, 50 deletions
diff --git a/gcc/ada/s-taprop-posix.adb b/gcc/ada/s-taprop-posix.adb
index a71c6dd..3ad2659 100644
--- a/gcc/ada/s-taprop-posix.adb
+++ b/gcc/ada/s-taprop-posix.adb
@@ -49,6 +49,14 @@ pragma Polling (Off);
with System.Tasking.Debug;
-- used for Known_Tasks
+with System.Interrupt_Management;
+-- used for Keep_Unmasked
+-- Abort_Task_Interrupt
+-- Interrupt_ID
+
+with System.OS_Primitives;
+-- used for Delay_Modes
+
with System.Task_Info;
-- used for Task_Info_Type
@@ -56,29 +64,9 @@ with Interfaces.C;
-- used for int
-- size_t
-with System.Interrupt_Management;
--- used for Keep_Unmasked
--- Abort_Task_Interrupt
--- Interrupt_ID
-
with System.Parameters;
-- used for Size_Type
-with System.Tasking;
--- used for Ada_Task_Control_Block
--- Task_Id
-
-with System.Soft_Links;
--- used for Defer/Undefer_Abort
-
--- Note that we do not use System.Tasking.Initialization directly since
--- this is a higher level package that we shouldn't depend on. For example
--- when using the restricted run time, it is replaced by
--- System.Tasking.Restricted.Stages.
-
-with System.OS_Primitives;
--- used for Delay_Modes
-
with Unchecked_Conversion;
with Unchecked_Deallocation;
@@ -91,8 +79,6 @@ package body System.Task_Primitives.Operations is
use System.Parameters;
use System.OS_Primitives;
- package SSL renames System.Soft_Links;
-
----------------
-- Local Data --
----------------
@@ -133,9 +119,6 @@ package body System.Task_Primitives.Operations is
Dispatching_Policy : Character;
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
- FIFO_Within_Priorities : constant Boolean := Dispatching_Policy = 'F';
- -- Indicates whether FIFO_Within_Priorities is set.
-
Foreign_Task_Elaborated : aliased Boolean := True;
-- Used to identified fake tasks (i.e., non-Ada Threads).
@@ -603,12 +586,6 @@ package body System.Task_Primitives.Operations is
Result : Interfaces.C.int;
begin
- -- Only the little window between deferring abort and
- -- locking Self_ID is the reason we need to
- -- check for pending abort and priority change below! :(
-
- SSL.Abort_Defer.all;
-
if Single_Lock then
Lock_RTS;
end if;
@@ -673,7 +650,6 @@ package body System.Task_Primitives.Operations is
end if;
Result := sched_yield;
- SSL.Abort_Undefer.all;
end Timed_Delay;
---------------------
@@ -746,7 +722,7 @@ package body System.Task_Primitives.Operations is
Result := pthread_setschedparam
(T.Common.LL.Thread, SCHED_RR, Param'Access);
- elsif FIFO_Within_Priorities or else Time_Slice_Val = 0 then
+ elsif Dispatching_Policy = 'F' or else Time_Slice_Val = 0 then
Result := pthread_setschedparam
(T.Common.LL.Thread, SCHED_FIFO, Param'Access);
@@ -1038,7 +1014,7 @@ package body System.Task_Primitives.Operations is
pragma Assert (Result = 0);
end Abort_Task;
- ----------------
+ ----------------
-- Initialize --
----------------
@@ -1323,6 +1299,20 @@ package body System.Task_Primitives.Operations is
begin
Environment_Task_Id := Environment_Task;
+ Interrupt_Management.Initialize;
+
+ -- Prepare the set of signals that should unblocked in all tasks
+
+ Result := sigemptyset (Unblocked_Signal_Mask'Access);
+ pragma Assert (Result = 0);
+
+ for J in Interrupt_Management.Interrupt_ID loop
+ if System.Interrupt_Management.Keep_Unmasked (J) then
+ Result := sigaddset (Unblocked_Signal_Mask'Access, Signal (J));
+ pragma Assert (Result = 0);
+ end if;
+ end loop;
+
-- Initialize the lock used to synchronize chain of all ATCBs.
Initialize_Lock (Single_RTS_Lock'Access, RTS_Lock_Level);
@@ -1352,20 +1342,4 @@ package body System.Task_Primitives.Operations is
end if;
end Initialize;
-begin
- declare
- Result : Interfaces.C.int;
- begin
- -- Prepare the set of signals that should unblocked in all tasks
-
- Result := sigemptyset (Unblocked_Signal_Mask'Access);
- pragma Assert (Result = 0);
-
- for J in Interrupt_Management.Interrupt_ID loop
- if System.Interrupt_Management.Keep_Unmasked (J) then
- Result := sigaddset (Unblocked_Signal_Mask'Access, Signal (J));
- pragma Assert (Result = 0);
- end if;
- end loop;
- end;
end System.Task_Primitives.Operations;