@@ -298,7 +298,7 @@ package System.OS_Interface is
function To_thread_t is new Ada.Unchecked_Conversion (Integer, thread_t);
- subtype mutex_t is System.OS_Lock.mutex_t;
+ subtype mutex_t is System.OS_Locks.mutex_t;
type cond_t is limited private;
@@ -1399,7 +1399,7 @@ package body System.Task_Primitives.Operations is
P := Self_ID.Common.LL.Locks;
if P /= null then
- L.Next := P;
+ L.Next := To_RTS_Lock_Ptr (P);
end if;
Self_ID.Common.LL.Locking := null;
@@ -1440,7 +1440,7 @@ package body System.Task_Primitives.Operations is
Self_ID.Common.LL.L.Owner := null;
P := Self_ID.Common.LL.Locks;
- Self_ID.Common.LL.Locks := Self_ID.Common.LL.Locks.Next;
+ Self_ID.Common.LL.Locks := To_Lock_Ptr (Self_ID.Common.LL.Locks.Next);
P.Next := null;
return True;
end Check_Sleep;
@@ -1468,7 +1468,7 @@ package body System.Task_Primitives.Operations is
P := Self_ID.Common.LL.Locks;
if P /= null then
- L.Next := P;
+ L.Next := To_RTS_Lock_Ptr (P);
end if;
Self_ID.Common.LL.Locking := null;
@@ -1549,7 +1549,7 @@ package body System.Task_Primitives.Operations is
L.Owner := null;
P := Self_ID.Common.LL.Locks;
- Self_ID.Common.LL.Locks := Self_ID.Common.LL.Locks.Next;
+ Self_ID.Common.LL.Locks := To_Lock_Ptr (Self_ID.Common.LL.Locks.Next);
P.Next := null;
return True;
end Check_Unlock;
@@ -246,6 +246,7 @@ package body System.Tasking.Initialization is
procedure Initialize_RTS_Lock (Addr : Address) is
Lock : aliased SOL.RTS_Lock;
for Lock'Address use Addr;
+ pragma Import (Ada, Lock);
begin
Initialize_Lock (Lock'Unchecked_Access, PO_Level);
@@ -258,6 +259,7 @@ package body System.Tasking.Initialization is
procedure Finalize_RTS_Lock (Addr : Address) is
Lock : aliased SOL.RTS_Lock;
for Lock'Address use Addr;
+ pragma Import (Ada, Lock);
begin
Finalize_Lock (Lock'Unchecked_Access);
@@ -270,6 +272,7 @@ package body System.Tasking.Initialization is
procedure Acquire_RTS_Lock (Addr : Address) is
Lock : aliased SOL.RTS_Lock;
for Lock'Address use Addr;
+ pragma Import (Ada, Lock);
begin
Write_Lock (Lock'Unchecked_Access);
@@ -282,6 +285,7 @@ package body System.Tasking.Initialization is
procedure Release_RTS_Lock (Addr : Address) is
Lock : aliased SOL.RTS_Lock;
for Lock'Address use Addr;
+ pragma Import (Ada, Lock);
begin
Unlock (Lock'Unchecked_Access);
@@ -47,6 +47,8 @@ package System.Task_Primitives is
function To_Lock_Ptr is
new Ada.Unchecked_Conversion (OS_Locks.RTS_Lock_Ptr, Lock_Ptr);
+ function To_RTS_Lock_Ptr is
+ new Ada.Unchecked_Conversion (Lock_Ptr, OS_Locks.RTS_Lock_Ptr);
type Suspension_Object is limited private;
-- Should be used for the implementation of Ada.Synchronous_Task_Control
@@ -31,6 +31,7 @@
-- This is a Solaris (native) version of this package
+with Ada.Unchecked_Conversion;
with Interfaces.C;
package System.OS_Locks is
@@ -65,10 +66,10 @@ package System.OS_Locks is
private
- type array_type_9 is array (0 .. 3) of unsigned_char;
+ type array_type_9 is array (0 .. 3) of Interfaces.C.unsigned_char;
type record_type_3 is record
flag : array_type_9;
- Xtype : unsigned_long;
+ Xtype : Interfaces.C.unsigned_long;
end record;
pragma Convention (C, record_type_3);
@@ -79,6 +80,6 @@ private
lock : upad64_t;
data : upad64_t;
end record;
- pragma Convention (C, mutex_t);
+ pragma Convention (C, mutex_t);
end System.OS_Locks;