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
any visibility settings if there are no compilation_unit pragmas
following the package declaration. Add comments for future
cleanup.
\ No newline at end of file
* 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.
\ No newline at end of file
......@@ -304,7 +304,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1448,7 +1448,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -1564,7 +1564,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -213,7 +213,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -239,7 +239,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -853,7 +853,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is
Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -987,7 +987,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......@@ -1012,7 +1012,7 @@ package body Ada.Containers.Bounded_Hashed_Maps is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -231,7 +231,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1077,7 +1077,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is
Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -1606,7 +1606,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1787,7 +1787,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is
Old_Pos => Position,
Old_Hash => Hash (Key (Position))))
do
Lock (Container.TC);
Busy (Container.TC);
end return;
end;
end Reference_Preserving_Key;
......@@ -1816,7 +1816,7 @@ package body Ada.Containers.Bounded_Hashed_Sets is
Old_Pos => P,
Old_Hash => Hash (Key)))
do
Lock (Container.TC);
Busy (Container.TC);
end return;
end;
end Reference_Preserving_Key;
......
......@@ -600,7 +600,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
(Element => Container.Elements (Position.Node)'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -2291,7 +2291,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -2490,7 +2490,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
(Element => Container.Elements (Position.Node)'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -420,7 +420,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -445,7 +445,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1256,7 +1256,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is
Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -1376,7 +1376,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......@@ -1401,7 +1401,7 @@ package body Ada.Containers.Bounded_Ordered_Maps is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -420,7 +420,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -741,7 +741,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is
(Element => N.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -937,7 +937,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is
Pos => Position,
Old_Key => new Key_Type'(Key (Position))))
do
Lock (Container.TC);
Busy (Container.TC);
end return;
end;
end Reference_Preserving_Key;
......@@ -965,7 +965,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is
Pos => Find (Container, Key),
Old_Key => new Key_Type'(Key)))
do
Lock (Container.TC);
Busy (Container.TC);
end return;
end;
end Reference_Preserving_Key;
......@@ -1598,7 +1598,7 @@ package body Ada.Containers.Bounded_Ordered_Sets is
Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......
......@@ -255,7 +255,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
(Element => Position.Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1226,7 +1226,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -1357,7 +1357,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
(Element => Position.Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -280,7 +280,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
(Element => Position.Node.Element,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1263,7 +1263,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -1405,7 +1405,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
(Element => Position.Node.Element,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -220,7 +220,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
(Element => Position.Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -249,7 +249,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
(Element => Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -911,7 +911,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
Container.HT.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -1057,7 +1057,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
(Element => Position.Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......@@ -1086,7 +1086,7 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
(Element => Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -239,7 +239,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
(Element => Position.Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1229,7 +1229,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
Container.HT.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -2044,7 +2044,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
(Element => Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -2232,7 +2232,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
Old_Pos => Position,
Old_Hash => Hash (Key (Position))))
do
Lock (HT.TC);
Busy (HT.TC);
end return;
end;
end Reference_Preserving_Key;
......@@ -2266,7 +2266,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
Old_Pos => P,
Old_Hash => Hash (Key)))
do
Lock (HT.TC);
Busy (HT.TC);
end return;
end;
end Reference_Preserving_Key;
......
......@@ -488,7 +488,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
(Element => Position.Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1847,7 +1847,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -2044,7 +2044,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is
(Element => Position.Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -374,7 +374,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
(Element => Position.Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -402,7 +402,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
(Element => Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1250,7 +1250,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
Container.Tree.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -1387,7 +1387,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
(Element => Position.Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......@@ -1415,7 +1415,7 @@ package body Ada.Containers.Indefinite_Ordered_Maps is
(Element => Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -394,7 +394,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
(Element => Position.Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -788,7 +788,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
(Element => Node.Element.all'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1017,7 +1017,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
Pos => Position,
Old_Key => new Key_Type'(Key (Position))))
do
Lock (Tree.TC);
Busy (Tree.TC);
end return;
end;
end Reference_Preserving_Key;
......@@ -1049,7 +1049,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
Pos => Find (Container, Key),
Old_Key => new Key_Type'(Key)))
do
Lock (Tree.TC);
Busy (Tree.TC);
end return;
end;
end Reference_Preserving_Key;
......@@ -1688,7 +1688,7 @@ package body Ada.Containers.Indefinite_Ordered_Sets is
Container.Tree.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......
......@@ -402,7 +402,7 @@ package body Ada.Containers.Bounded_Vectors is
(Element => A (J)'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -426,7 +426,7 @@ package body Ada.Containers.Bounded_Vectors is
(Element => A (J)'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -2067,7 +2067,7 @@ package body Ada.Containers.Bounded_Vectors is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -2183,7 +2183,7 @@ package body Ada.Containers.Bounded_Vectors is
(Element => A (J)'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......@@ -2207,7 +2207,7 @@ package body Ada.Containers.Bounded_Vectors is
(Element => A (J)'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -213,7 +213,7 @@ package body Ada.Containers.Hashed_Maps is
(Element => Position.Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -238,7 +238,7 @@ package body Ada.Containers.Hashed_Maps is
(Element => Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -836,7 +836,7 @@ package body Ada.Containers.Hashed_Maps is
Container.HT.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -937,7 +937,7 @@ package body Ada.Containers.Hashed_Maps is
(Element => Position.Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......@@ -962,7 +962,7 @@ package body Ada.Containers.Hashed_Maps is
(Element => Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -223,7 +223,7 @@ package body Ada.Containers.Hashed_Sets is
(Element => Position.Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1119,7 +1119,7 @@ package body Ada.Containers.Hashed_Sets is
Container.HT.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -1839,7 +1839,7 @@ package body Ada.Containers.Hashed_Sets is
(Element => Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -2025,7 +2025,7 @@ package body Ada.Containers.Hashed_Sets is
Old_Pos => Position,
Old_Hash => Hash (Key (Position))))
do
Lock (HT.TC);
Busy (HT.TC);
end return;
end;
end Reference_Preserving_Key;
......@@ -2055,7 +2055,7 @@ package body Ada.Containers.Hashed_Sets is
Old_Pos => P,
Old_Hash => Hash (Key)))
do
Lock (HT.TC);
Busy (HT.TC);
end return;
end;
end Reference_Preserving_Key;
......
......@@ -324,7 +324,7 @@ package body Ada.Containers.Indefinite_Vectors is
(Element => Container.Elements.EA (Position.Index),
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -348,7 +348,7 @@ package body Ada.Containers.Indefinite_Vectors is
(Element => Container.Elements.EA (Index),
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -2586,7 +2586,7 @@ package body Ada.Containers.Indefinite_Vectors is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -2718,7 +2718,7 @@ package body Ada.Containers.Indefinite_Vectors is
(Element => Container.Elements.EA (Position.Index),
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......@@ -2742,7 +2742,7 @@ package body Ada.Containers.Indefinite_Vectors is
(Element => Container.Elements.EA (Index),
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -469,7 +469,7 @@ package body Ada.Containers.Multiway_Trees is
(Element => Position.Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1830,7 +1830,7 @@ package body Ada.Containers.Multiway_Trees is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -2023,7 +2023,7 @@ package body Ada.Containers.Multiway_Trees is
(Element => Position.Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -38,7 +38,7 @@ package body Ada.Containers.Helpers is
procedure Adjust (Control : in out Reference_Control_Type) is
begin
if Control.T_Counts /= null then
Lock (Control.T_Counts.all);
Busy (Control.T_Counts.all);
end if;
end Adjust;
......@@ -60,7 +60,7 @@ package body Ada.Containers.Helpers is
procedure Finalize (Control : in out Reference_Control_Type) is
begin
if Control.T_Counts /= null then
Unlock (Control.T_Counts.all);
Unbusy (Control.T_Counts.all);
Control.T_Counts := null;
end if;
end Finalize;
......
......@@ -294,7 +294,7 @@ package body Ada.Containers.Vectors is
(Element => Container.Elements.EA (Position.Index)'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -316,7 +316,7 @@ package body Ada.Containers.Vectors is
(Element => Container.Elements.EA (Index)'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -2293,7 +2293,7 @@ package body Ada.Containers.Vectors is
TC : constant Tamper_Counts_Access := Container.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -2409,7 +2409,7 @@ package body Ada.Containers.Vectors is
(Element => Container.Elements.EA (Position.Index)'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......@@ -2431,7 +2431,7 @@ package body Ada.Containers.Vectors is
(Element => Container.Elements.EA (Index)'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -336,7 +336,7 @@ package body Ada.Containers.Ordered_Maps is
(Element => Position.Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -361,7 +361,7 @@ package body Ada.Containers.Ordered_Maps is
(Element => Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -1180,7 +1180,7 @@ package body Ada.Containers.Ordered_Maps is
Container.Tree.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
end Pseudo_Reference;
......@@ -1307,7 +1307,7 @@ package body Ada.Containers.Ordered_Maps is
(Element => Position.Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......@@ -1332,7 +1332,7 @@ package body Ada.Containers.Ordered_Maps is
(Element => Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Reference;
......
......@@ -349,7 +349,7 @@ package body Ada.Containers.Ordered_Sets is
(Element => Position.Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -706,7 +706,7 @@ package body Ada.Containers.Ordered_Sets is
(Element => Node.Element'Access,
Control => (Controlled with TC))
do
Lock (TC.all);
Busy (TC.all);
end return;
end;
end Constant_Reference;
......@@ -903,7 +903,7 @@ package body Ada.Containers.Ordered_Sets is
Pos => Position,
Old_Key => new Key_Type'(Key (Position))))
do
Lock (Tree.TC);
Busy (Tree.TC);
end return;
end;
end Reference_Preserving_Key;
......@@ -931,7 +931,7 @@ package body Ada.Containers.Ordered_Sets is
Pos => Find (Container, Key),
Old_Key => new Key_Type'(Key)))
do
Lock (Tree.TC);
Busy (Tree.TC);
end return;
end;
end Reference_Preserving_Key;
......@@ -1550,7 +1550,7 @@ package body Ada.Containers.Ordered_Sets is
Container.Tree.TC'Unrestricted_Access;
begin
return R : constant Reference_Control_Type := (Controlled with TC) do
Lock (TC.all);
Busy (TC.all);
end return;
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