Commit 2f26abcc by Bob Duff Committed by Pierre-Marie de Rodat

[Ada] Replace in Ordered_Maps gets tampering failure

2019-10-10  Bob Duff  <duff@adacore.com>

gcc/ada/

	* libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb,
	libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb,
	libgnat/a-cborma.adb, libgnat/a-cborse.adb,
	libgnat/a-cdlili.adb, libgnat/a-cidlli.adb,
	libgnat/a-cihama.adb, libgnat/a-cihase.adb,
	libgnat/a-cimutr.adb, libgnat/a-ciorma.adb,
	libgnat/a-ciorse.adb, libgnat/a-cobove.adb,
	libgnat/a-cohama.adb, libgnat/a-cohase.adb,
	libgnat/a-coinve.adb, libgnat/a-comutr.adb,
	libgnat/a-conhel.adb, libgnat/a-convec.adb,
	libgnat/a-coorma.adb, libgnat/a-coorse.adb (Reference,
	Constant_Reference): Use Busy instead of Lock, so we forbid
	tampering with cursors, rather than tampering with elements.

From-SVN: r276813
parent c223b764
2019-10-10 Ed Schonberg <schonberg@adacore.com> 2019-10-10 Bob Duff <duff@adacore.com>
* sem_cat.adb (Set_Categorization_From_Pragma): Do not modify * libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb,
any visibility settings if there are no compilation_unit pragmas libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb,
following the package declaration. Add comments for future libgnat/a-cborma.adb, libgnat/a-cborse.adb,
cleanup. libgnat/a-cdlili.adb, libgnat/a-cidlli.adb,
\ No newline at end of file libgnat/a-cihama.adb, libgnat/a-cihase.adb,
libgnat/a-cimutr.adb, libgnat/a-ciorma.adb,
libgnat/a-ciorse.adb, libgnat/a-cobove.adb,
libgnat/a-cohama.adb, libgnat/a-cohase.adb,
libgnat/a-coinve.adb, libgnat/a-comutr.adb,
libgnat/a-conhel.adb, libgnat/a-convec.adb,
libgnat/a-coorma.adb, libgnat/a-coorse.adb (Reference,
Constant_Reference): Use Busy instead of Lock, so we forbid
tampering with cursors, rather than tampering with elements.
\ No newline at end of file
...@@ -304,7 +304,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is ...@@ -304,7 +304,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1448,7 +1448,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is ...@@ -1448,7 +1448,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -1564,7 +1564,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is ...@@ -1564,7 +1564,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -213,7 +213,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is ...@@ -213,7 +213,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -239,7 +239,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is ...@@ -239,7 +239,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -853,7 +853,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is ...@@ -853,7 +853,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is
Container.TC'Unrestricted_Access; Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -987,7 +987,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is ...@@ -987,7 +987,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
...@@ -1012,7 +1012,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is ...@@ -1012,7 +1012,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -231,7 +231,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is ...@@ -231,7 +231,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1077,7 +1077,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is ...@@ -1077,7 +1077,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is
Container.TC'Unrestricted_Access; Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -1606,7 +1606,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is ...@@ -1606,7 +1606,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1787,7 +1787,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is ...@@ -1787,7 +1787,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is
Old_Pos => Position, Old_Pos => Position,
Old_Hash => Hash (Key (Position)))) Old_Hash => Hash (Key (Position))))
do do
Lock (Container.TC); Busy (Container.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
...@@ -1816,7 +1816,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is ...@@ -1816,7 +1816,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is
Old_Pos => P, Old_Pos => P,
Old_Hash => Hash (Key))) Old_Hash => Hash (Key)))
do do
Lock (Container.TC); Busy (Container.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
......
...@@ -600,7 +600,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is ...@@ -600,7 +600,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
(Element => Container.Elements (Position.Node)'Access, (Element => Container.Elements (Position.Node)'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -2291,7 +2291,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is ...@@ -2291,7 +2291,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -2490,7 +2490,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is ...@@ -2490,7 +2490,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
(Element => Container.Elements (Position.Node)'Access, (Element => Container.Elements (Position.Node)'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -420,7 +420,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is ...@@ -420,7 +420,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -445,7 +445,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is ...@@ -445,7 +445,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1256,7 +1256,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is ...@@ -1256,7 +1256,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is
Container.TC'Unrestricted_Access; Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -1376,7 +1376,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is ...@@ -1376,7 +1376,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
...@@ -1401,7 +1401,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is ...@@ -1401,7 +1401,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -420,7 +420,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is ...@@ -420,7 +420,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -741,7 +741,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is ...@@ -741,7 +741,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is
(Element => N.Element'Access, (Element => N.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -937,7 +937,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is ...@@ -937,7 +937,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is
Pos => Position, Pos => Position,
Old_Key => new Key_Type'(Key (Position)))) Old_Key => new Key_Type'(Key (Position))))
do do
Lock (Container.TC); Busy (Container.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
...@@ -965,7 +965,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is ...@@ -965,7 +965,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is
Pos => Find (Container, Key), Pos => Find (Container, Key),
Old_Key => new Key_Type'(Key))) Old_Key => new Key_Type'(Key)))
do do
Lock (Container.TC); Busy (Container.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
...@@ -1598,7 +1598,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is ...@@ -1598,7 +1598,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is
Container.TC'Unrestricted_Access; Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
......
...@@ -255,7 +255,7 @@ package body Ada.Containers.Doubly_Linked_Lists is ...@@ -255,7 +255,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
(Element => Position.Node.Element'Access, (Element => Position.Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1226,7 +1226,7 @@ package body Ada.Containers.Doubly_Linked_Lists is ...@@ -1226,7 +1226,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -1357,7 +1357,7 @@ package body Ada.Containers.Doubly_Linked_Lists is ...@@ -1357,7 +1357,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
(Element => Position.Node.Element'Access, (Element => Position.Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -280,7 +280,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is ...@@ -280,7 +280,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
(Element => Position.Node.Element, (Element => Position.Node.Element,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1263,7 +1263,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is ...@@ -1263,7 +1263,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -1405,7 +1405,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is ...@@ -1405,7 +1405,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
(Element => Position.Node.Element, (Element => Position.Node.Element,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -220,7 +220,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is ...@@ -220,7 +220,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
(Element => Position.Node.Element.all'Access, (Element => Position.Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -249,7 +249,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is ...@@ -249,7 +249,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
(Element => Node.Element.all'Access, (Element => Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -911,7 +911,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is ...@@ -911,7 +911,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
Container.HT.TC'Unrestricted_Access; Container.HT.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -1057,7 +1057,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is ...@@ -1057,7 +1057,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
(Element => Position.Node.Element.all'Access, (Element => Position.Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
...@@ -1086,7 +1086,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is ...@@ -1086,7 +1086,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
(Element => Node.Element.all'Access, (Element => Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -239,7 +239,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is ...@@ -239,7 +239,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
(Element => Position.Node.Element.all'Access, (Element => Position.Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1229,7 +1229,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is ...@@ -1229,7 +1229,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
Container.HT.TC'Unrestricted_Access; Container.HT.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -2044,7 +2044,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is ...@@ -2044,7 +2044,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
(Element => Node.Element.all'Access, (Element => Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -2232,7 +2232,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is ...@@ -2232,7 +2232,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
Old_Pos => Position, Old_Pos => Position,
Old_Hash => Hash (Key (Position)))) Old_Hash => Hash (Key (Position))))
do do
Lock (HT.TC); Busy (HT.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
...@@ -2266,7 +2266,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is ...@@ -2266,7 +2266,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
Old_Pos => P, Old_Pos => P,
Old_Hash => Hash (Key))) Old_Hash => Hash (Key)))
do do
Lock (HT.TC); Busy (HT.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
......
...@@ -488,7 +488,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is ...@@ -488,7 +488,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
(Element => Position.Node.Element.all'Access, (Element => Position.Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1847,7 +1847,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is ...@@ -1847,7 +1847,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -2044,7 +2044,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is ...@@ -2044,7 +2044,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
(Element => Position.Node.Element.all'Access, (Element => Position.Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -374,7 +374,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is ...@@ -374,7 +374,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
(Element => Position.Node.Element.all'Access, (Element => Position.Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -402,7 +402,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is ...@@ -402,7 +402,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
(Element => Node.Element.all'Access, (Element => Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1250,7 +1250,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is ...@@ -1250,7 +1250,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
Container.Tree.TC'Unrestricted_Access; Container.Tree.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -1387,7 +1387,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is ...@@ -1387,7 +1387,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
(Element => Position.Node.Element.all'Access, (Element => Position.Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
...@@ -1415,7 +1415,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is ...@@ -1415,7 +1415,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
(Element => Node.Element.all'Access, (Element => Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -394,7 +394,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is ...@@ -394,7 +394,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
(Element => Position.Node.Element.all'Access, (Element => Position.Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -788,7 +788,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is ...@@ -788,7 +788,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
(Element => Node.Element.all'Access, (Element => Node.Element.all'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1017,7 +1017,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is ...@@ -1017,7 +1017,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
Pos => Position, Pos => Position,
Old_Key => new Key_Type'(Key (Position)))) Old_Key => new Key_Type'(Key (Position))))
do do
Lock (Tree.TC); Busy (Tree.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
...@@ -1049,7 +1049,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is ...@@ -1049,7 +1049,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
Pos => Find (Container, Key), Pos => Find (Container, Key),
Old_Key => new Key_Type'(Key))) Old_Key => new Key_Type'(Key)))
do do
Lock (Tree.TC); Busy (Tree.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
...@@ -1688,7 +1688,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is ...@@ -1688,7 +1688,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
Container.Tree.TC'Unrestricted_Access; Container.Tree.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
......
...@@ -402,7 +402,7 @@ package body Ada.Containers.Bounded_Vectors is ...@@ -402,7 +402,7 @@ package body Ada.Containers.Bounded_Vectors is
(Element => A (J)'Access, (Element => A (J)'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -426,7 +426,7 @@ package body Ada.Containers.Bounded_Vectors is ...@@ -426,7 +426,7 @@ package body Ada.Containers.Bounded_Vectors is
(Element => A (J)'Access, (Element => A (J)'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -2067,7 +2067,7 @@ package body Ada.Containers.Bounded_Vectors is ...@@ -2067,7 +2067,7 @@ package body Ada.Containers.Bounded_Vectors is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -2183,7 +2183,7 @@ package body Ada.Containers.Bounded_Vectors is ...@@ -2183,7 +2183,7 @@ package body Ada.Containers.Bounded_Vectors is
(Element => A (J)'Access, (Element => A (J)'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
...@@ -2207,7 +2207,7 @@ package body Ada.Containers.Bounded_Vectors is ...@@ -2207,7 +2207,7 @@ package body Ada.Containers.Bounded_Vectors is
(Element => A (J)'Access, (Element => A (J)'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -213,7 +213,7 @@ package body Ada.Containers.Hashed_Maps is ...@@ -213,7 +213,7 @@ package body Ada.Containers.Hashed_Maps is
(Element => Position.Node.Element'Access, (Element => Position.Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -238,7 +238,7 @@ package body Ada.Containers.Hashed_Maps is ...@@ -238,7 +238,7 @@ package body Ada.Containers.Hashed_Maps is
(Element => Node.Element'Access, (Element => Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -836,7 +836,7 @@ package body Ada.Containers.Hashed_Maps is ...@@ -836,7 +836,7 @@ package body Ada.Containers.Hashed_Maps is
Container.HT.TC'Unrestricted_Access; Container.HT.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -937,7 +937,7 @@ package body Ada.Containers.Hashed_Maps is ...@@ -937,7 +937,7 @@ package body Ada.Containers.Hashed_Maps is
(Element => Position.Node.Element'Access, (Element => Position.Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
...@@ -962,7 +962,7 @@ package body Ada.Containers.Hashed_Maps is ...@@ -962,7 +962,7 @@ package body Ada.Containers.Hashed_Maps is
(Element => Node.Element'Access, (Element => Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -223,7 +223,7 @@ package body Ada.Containers.Hashed_Sets is ...@@ -223,7 +223,7 @@ package body Ada.Containers.Hashed_Sets is
(Element => Position.Node.Element'Access, (Element => Position.Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1119,7 +1119,7 @@ package body Ada.Containers.Hashed_Sets is ...@@ -1119,7 +1119,7 @@ package body Ada.Containers.Hashed_Sets is
Container.HT.TC'Unrestricted_Access; Container.HT.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -1839,7 +1839,7 @@ package body Ada.Containers.Hashed_Sets is ...@@ -1839,7 +1839,7 @@ package body Ada.Containers.Hashed_Sets is
(Element => Node.Element'Access, (Element => Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -2025,7 +2025,7 @@ package body Ada.Containers.Hashed_Sets is ...@@ -2025,7 +2025,7 @@ package body Ada.Containers.Hashed_Sets is
Old_Pos => Position, Old_Pos => Position,
Old_Hash => Hash (Key (Position)))) Old_Hash => Hash (Key (Position))))
do do
Lock (HT.TC); Busy (HT.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
...@@ -2055,7 +2055,7 @@ package body Ada.Containers.Hashed_Sets is ...@@ -2055,7 +2055,7 @@ package body Ada.Containers.Hashed_Sets is
Old_Pos => P, Old_Pos => P,
Old_Hash => Hash (Key))) Old_Hash => Hash (Key)))
do do
Lock (HT.TC); Busy (HT.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
......
...@@ -324,7 +324,7 @@ package body Ada.Containers.Indefinite_Vectors is ...@@ -324,7 +324,7 @@ package body Ada.Containers.Indefinite_Vectors is
(Element => Container.Elements.EA (Position.Index), (Element => Container.Elements.EA (Position.Index),
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -348,7 +348,7 @@ package body Ada.Containers.Indefinite_Vectors is ...@@ -348,7 +348,7 @@ package body Ada.Containers.Indefinite_Vectors is
(Element => Container.Elements.EA (Index), (Element => Container.Elements.EA (Index),
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -2586,7 +2586,7 @@ package body Ada.Containers.Indefinite_Vectors is ...@@ -2586,7 +2586,7 @@ package body Ada.Containers.Indefinite_Vectors is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -2718,7 +2718,7 @@ package body Ada.Containers.Indefinite_Vectors is ...@@ -2718,7 +2718,7 @@ package body Ada.Containers.Indefinite_Vectors is
(Element => Container.Elements.EA (Position.Index), (Element => Container.Elements.EA (Position.Index),
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
...@@ -2742,7 +2742,7 @@ package body Ada.Containers.Indefinite_Vectors is ...@@ -2742,7 +2742,7 @@ package body Ada.Containers.Indefinite_Vectors is
(Element => Container.Elements.EA (Index), (Element => Container.Elements.EA (Index),
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -469,7 +469,7 @@ package body Ada.Containers.Multiway_Trees is ...@@ -469,7 +469,7 @@ package body Ada.Containers.Multiway_Trees is
(Element => Position.Node.Element'Access, (Element => Position.Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1830,7 +1830,7 @@ package body Ada.Containers.Multiway_Trees is ...@@ -1830,7 +1830,7 @@ package body Ada.Containers.Multiway_Trees is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -2023,7 +2023,7 @@ package body Ada.Containers.Multiway_Trees is ...@@ -2023,7 +2023,7 @@ package body Ada.Containers.Multiway_Trees is
(Element => Position.Node.Element'Access, (Element => Position.Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -38,7 +38,7 @@ package body Ada.Containers.Helpers is ...@@ -38,7 +38,7 @@ package body Ada.Containers.Helpers is
procedure Adjust (Control : in out Reference_Control_Type) is procedure Adjust (Control : in out Reference_Control_Type) is
begin begin
if Control.T_Counts /= null then if Control.T_Counts /= null then
Lock (Control.T_Counts.all); Busy (Control.T_Counts.all);
end if; end if;
end Adjust; end Adjust;
...@@ -60,7 +60,7 @@ package body Ada.Containers.Helpers is ...@@ -60,7 +60,7 @@ package body Ada.Containers.Helpers is
procedure Finalize (Control : in out Reference_Control_Type) is procedure Finalize (Control : in out Reference_Control_Type) is
begin begin
if Control.T_Counts /= null then if Control.T_Counts /= null then
Unlock (Control.T_Counts.all); Unbusy (Control.T_Counts.all);
Control.T_Counts := null; Control.T_Counts := null;
end if; end if;
end Finalize; end Finalize;
......
...@@ -294,7 +294,7 @@ package body Ada.Containers.Vectors is ...@@ -294,7 +294,7 @@ package body Ada.Containers.Vectors is
(Element => Container.Elements.EA (Position.Index)'Access, (Element => Container.Elements.EA (Position.Index)'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -316,7 +316,7 @@ package body Ada.Containers.Vectors is ...@@ -316,7 +316,7 @@ package body Ada.Containers.Vectors is
(Element => Container.Elements.EA (Index)'Access, (Element => Container.Elements.EA (Index)'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -2293,7 +2293,7 @@ package body Ada.Containers.Vectors is ...@@ -2293,7 +2293,7 @@ package body Ada.Containers.Vectors is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access; TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -2409,7 +2409,7 @@ package body Ada.Containers.Vectors is ...@@ -2409,7 +2409,7 @@ package body Ada.Containers.Vectors is
(Element => Container.Elements.EA (Position.Index)'Access, (Element => Container.Elements.EA (Position.Index)'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
...@@ -2431,7 +2431,7 @@ package body Ada.Containers.Vectors is ...@@ -2431,7 +2431,7 @@ package body Ada.Containers.Vectors is
(Element => Container.Elements.EA (Index)'Access, (Element => Container.Elements.EA (Index)'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -336,7 +336,7 @@ package body Ada.Containers.Ordered_Maps is ...@@ -336,7 +336,7 @@ package body Ada.Containers.Ordered_Maps is
(Element => Position.Node.Element'Access, (Element => Position.Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -361,7 +361,7 @@ package body Ada.Containers.Ordered_Maps is ...@@ -361,7 +361,7 @@ package body Ada.Containers.Ordered_Maps is
(Element => Node.Element'Access, (Element => Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -1180,7 +1180,7 @@ package body Ada.Containers.Ordered_Maps is ...@@ -1180,7 +1180,7 @@ package body Ada.Containers.Ordered_Maps is
Container.Tree.TC'Unrestricted_Access; Container.Tree.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
...@@ -1307,7 +1307,7 @@ package body Ada.Containers.Ordered_Maps is ...@@ -1307,7 +1307,7 @@ package body Ada.Containers.Ordered_Maps is
(Element => Position.Node.Element'Access, (Element => Position.Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
...@@ -1332,7 +1332,7 @@ package body Ada.Containers.Ordered_Maps is ...@@ -1332,7 +1332,7 @@ package body Ada.Containers.Ordered_Maps is
(Element => Node.Element'Access, (Element => Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Reference; end Reference;
......
...@@ -349,7 +349,7 @@ package body Ada.Containers.Ordered_Sets is ...@@ -349,7 +349,7 @@ package body Ada.Containers.Ordered_Sets is
(Element => Position.Node.Element'Access, (Element => Position.Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -706,7 +706,7 @@ package body Ada.Containers.Ordered_Sets is ...@@ -706,7 +706,7 @@ package body Ada.Containers.Ordered_Sets is
(Element => Node.Element'Access, (Element => Node.Element'Access,
Control => (Controlled with TC)) Control => (Controlled with TC))
do do
Lock (TC.all); Busy (TC.all);
end return; end return;
end; end;
end Constant_Reference; end Constant_Reference;
...@@ -903,7 +903,7 @@ package body Ada.Containers.Ordered_Sets is ...@@ -903,7 +903,7 @@ package body Ada.Containers.Ordered_Sets is
Pos => Position, Pos => Position,
Old_Key => new Key_Type'(Key (Position)))) Old_Key => new Key_Type'(Key (Position))))
do do
Lock (Tree.TC); Busy (Tree.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
...@@ -931,7 +931,7 @@ package body Ada.Containers.Ordered_Sets is ...@@ -931,7 +931,7 @@ package body Ada.Containers.Ordered_Sets is
Pos => Find (Container, Key), Pos => Find (Container, Key),
Old_Key => new Key_Type'(Key))) Old_Key => new Key_Type'(Key)))
do do
Lock (Tree.TC); Busy (Tree.TC);
end return; end return;
end; end;
end Reference_Preserving_Key; end Reference_Preserving_Key;
...@@ -1550,7 +1550,7 @@ package body Ada.Containers.Ordered_Sets is ...@@ -1550,7 +1550,7 @@ package body Ada.Containers.Ordered_Sets is
Container.Tree.TC'Unrestricted_Access; Container.Tree.TC'Unrestricted_Access;
begin begin
return R : constant Reference_Control_Type := (Controlled with TC) do return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all); Busy (TC.all);
end return; end return;
end Pseudo_Reference; end Pseudo_Reference;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment