with System.Tasking.Debug;
with System.Interrupt_Management;
+with System.OS_Constants;
with System.OS_Primitives;
with System.Task_Info;
package body System.Task_Primitives.Operations is
+ package OSC renames System.OS_Constants;
package SSL renames System.Soft_Links;
use System.Tasking.Debug;
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
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
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
---------------
procedure Read_Lock
- (L : not null access RW_Lock;
+ (L : not null access Lock;
Ceiling_Violation : out Boolean)
is
begin
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)
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;
-- 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));