Comments
Patch
===================================================================
@@ -59,15 +59,16 @@
"attempt to tamper with cursors (container is busy)";
end if;
+ -- The lock status (which monitors "element tampering") always implies
+ -- that the busy status (which monitors "cursor tampering") is set too;
+ -- this is a representation invariant. Thus if the busy bit is not set,
+ -- then the lock bit must not be set either.
+ pragma Assert (Tree.Lock = 0);
+
Tree.First := 0;
Tree.Last := 0;
Tree.Root := 0;
Tree.Length := 0;
-
- -- Why are the following commented out with no explanation ???
- -- Tree.Busy
- -- Tree.Lock
-
Tree.Free := -1;
end Clear_Tree;