summaryrefslogtreecommitdiff
path: root/gcc/ada/s-taprop-tru64.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/s-taprop-tru64.adb')
-rw-r--r--gcc/ada/s-taprop-tru64.adb79
1 files changed, 26 insertions, 53 deletions
diff --git a/gcc/ada/s-taprop-tru64.adb b/gcc/ada/s-taprop-tru64.adb
index 13178e575b7..d4846d545e3 100644
--- a/gcc/ada/s-taprop-tru64.adb
+++ b/gcc/ada/s-taprop-tru64.adb
@@ -43,6 +43,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
@@ -53,30 +61,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
--- ATCB components and types
-
-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_Deallocation;
package body System.Task_Primitives.Operations is
@@ -88,8 +75,6 @@ package body System.Task_Primitives.Operations is
use System.Parameters;
use System.OS_Primitives;
- package SSL renames System.Soft_Links;
-
----------------
-- Local Data --
----------------
@@ -120,9 +105,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
-
Curpid : pid_t;
Foreign_Task_Elaborated : aliased Boolean := True;
@@ -527,12 +509,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;
@@ -585,7 +561,6 @@ package body System.Task_Primitives.Operations is
end if;
Yield;
- SSL.Abort_Undefer.all;
end Timed_Delay;
---------------------
@@ -661,7 +636,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);
@@ -846,7 +821,7 @@ package body System.Task_Primitives.Operations is
Result := pthread_attr_setschedpolicy
(Attributes'Access, System.OS_Interface.SCHED_RR);
- elsif FIFO_Within_Priorities or else Time_Slice_Val = 0 then
+ elsif Dispatching_Policy = 'F' or else Time_Slice_Val = 0 then
Result := pthread_attr_setschedpolicy
(Attributes'Access, System.OS_Interface.SCHED_FIFO);
@@ -1240,6 +1215,22 @@ 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;
+
+ Curpid := getpid;
+
-- Initialize the lock used to synchronize chain of all ATCBs
Initialize_Lock (Single_RTS_Lock'Access, RTS_Lock_Level);
@@ -1269,22 +1260,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;
-
- Curpid := getpid;
end System.Task_Primitives.Operations;