OSDN Git Service

PR ada/52494
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-taprop-tru64.adb
index 28dabc5..8d69e5b 100644 (file)
@@ -43,6 +43,7 @@ with Interfaces.C;
 
 with System.Tasking.Debug;
 with System.Interrupt_Management;
+with System.OS_Constants;
 with System.OS_Primitives;
 with System.Task_Info;
 
@@ -54,6 +55,7 @@ with System.Soft_Links;
 
 package body System.Task_Primitives.Operations is
 
+   package OSC renames System.OS_Constants;
    package SSL renames System.Soft_Links;
 
    use System.Tasking.Debug;
@@ -266,14 +268,6 @@ package body System.Task_Primitives.Operations is
    end Initialize_Lock;
 
    procedure Initialize_Lock
-     (Prio : System.Any_Priority;
-      L    : not null access RW_Lock)
-   is
-   begin
-      Initialize_Lock (Prio, Lock (L.all)'Unrestricted_Access);
-   end Initialize_Lock;
-
-   procedure Initialize_Lock
      (L     : not null access RTS_Lock;
       Level : Lock_Level)
    is
@@ -313,11 +307,6 @@ package body System.Task_Primitives.Operations is
       pragma Assert (Result = 0);
    end Finalize_Lock;
 
-   procedure Finalize_Lock (L : not null access RW_Lock) is
-   begin
-      Finalize_Lock (Lock (L.all)'Unrestricted_Access);
-   end Finalize_Lock;
-
    procedure Finalize_Lock (L : not null access RTS_Lock) is
       Result : Interfaces.C.int;
    begin
@@ -363,14 +352,6 @@ package body System.Task_Primitives.Operations is
    end Write_Lock;
 
    procedure Write_Lock
-     (L                 : not null access RW_Lock;
-      Ceiling_Violation : out Boolean)
-   is
-   begin
-      Write_Lock (Lock (L.all)'Unrestricted_Access, Ceiling_Violation);
-   end Write_Lock;
-
-   procedure Write_Lock
      (L           : not null access RTS_Lock;
       Global_Lock : Boolean := False)
    is
@@ -396,7 +377,7 @@ package body System.Task_Primitives.Operations is
    ---------------
 
    procedure Read_Lock
-     (L                 : not null access RW_Lock;
+     (L                 : not null access Lock;
       Ceiling_Violation : out Boolean)
    is
    begin
@@ -414,11 +395,6 @@ package body System.Task_Primitives.Operations is
       pragma Assert (Result = 0);
    end Unlock;
 
-   procedure Unlock (L : not null access RW_Lock) is
-   begin
-      Unlock (Lock (L.all)'Unrestricted_Access);
-   end Unlock;
-
    procedure Unlock
      (L           : not null access RTS_Lock;
       Global_Lock : Boolean := False)
@@ -615,7 +591,7 @@ package body System.Task_Primitives.Operations is
       TS     : aliased timespec;
       Result : Interfaces.C.int;
    begin
-      Result := clock_gettime (CLOCK_REALTIME, TS'Unchecked_Access);
+      Result := clock_gettime (OSC.CLOCK_RT_Ada, TS'Unchecked_Access);
       pragma Assert (Result = 0);
       return To_Duration (TS);
    end Monotonic_Clock;
@@ -913,9 +889,15 @@ package body System.Task_Primitives.Operations is
       --  do not need to manipulate caller's signal mask at this point.
       --  All tasks in RTS will have All_Tasks_Mask initially.
 
+      --  Note: the use of Unrestricted_Access in the following call is needed
+      --  because otherwise we have an error of getting a access-to-volatile
+      --  value which points to a non-volatile object. But in this case it is
+      --  safe to do this, since we know we have no problems with aliasing and
+      --  Unrestricted_Access bypasses this check.
+
       Result :=
         pthread_create
-          (T.Common.LL.Thread'Access,
+          (T.Common.LL.Thread'Unrestricted_Access,
            Attributes'Access,
            Thread_Body_Access (Wrapper),
            To_Address (T));