* May not dereferenced access values
* Function calls and attribute references must be static
-
+If the Lock_Free aspect is specified to be True for a protected unit
+and the Ceiling_Locking locking policy is in effect, then the run-time
+actions associated with the Ceiling_Locking locking policy (described in
+Ada RM D.3) are not performed when a protected operation of the protected
+unit is executed.
+
Pragma Loop_Invariant
=====================
@copying
@quotation
-GNAT Reference Manual , Aug 25, 2022
+GNAT Reference Manual , Sep 09, 2022
AdaCore
Function calls and attribute references must be static
@end itemize
+If the Lock_Free aspect is specified to be True for a protected unit
+and the Ceiling_Locking locking policy is in effect, then the run-time
+actions associated with the Ceiling_Locking locking policy (described in
+Ada RM D.3) are not performed when a protected operation of the protected
+unit is executed.
+
@node Pragma Loop_Invariant,Pragma Loop_Optimize,Pragma Lock_Free,Implementation Defined Pragmas
@anchor{gnat_rm/implementation_defined_pragmas pragma-loop-invariant}@anchor{95}
@section Pragma Loop_Invariant
begin
if not Support_Atomic_Primitives_On_Target then
+ if Lock_Free_Given then
+ Error_Msg_N
+ ("Lock_Free aspect requires target support for "
+ & "atomic primitives", N);
+ end if;
return False;
end if;
+ -- Deal with case where Ceiling_Locking locking policy is
+ -- in effect.
+
+ if Locking_Policy = 'C' then
+ if Lock_Free_Given then
+ -- Explicit Lock_Free aspect spec overrides
+ -- Ceiling_Locking so we generate a warning.
+
+ Error_Msg_N
+ ("Lock_Free aspect specification overrides "
+ & "Ceiling_Locking locking policy??", N);
+ else
+ -- If Ceiling_Locking locking policy is in effect, then
+ -- Lock_Free can be explicitly specified but it is
+ -- never the default.
+
+ return False;
+ end if;
+ end if;
+
-- Get the number of errors detected by the compiler so far
if Lock_Free_Given then