generic package implements a thread-safe linked list that can be -- modified by one thread while another is iterating. The list is locked at two -- levels- the list level and the element level. The only restrictions are that -- new elements can only be prepended or appended, and an element can't be -- modified or removed from the list while it is being examined. package Fully_Mutable_Lists is
type List is tagged limited private;
type Cursor is private;
CONTAINER_ERROR : exception;
procedure Close
( | position | : in out Cursor ); |
procedure Next
( | position | : in out Cursor ); |
procedure Append
( | this | : access List; |
element | : Element_Type ); |
procedure Find
( | this | : access List; |
element | : Element_Type; | |
position | : out Cursor ); |
procedure Iterate
( | this | : access List; |
examine | : access procedure( element : Element_Type ) |
procedure Iterate_With_Quit
( | this | : access List; |
examine | : access procedure( element : Element_Type; | |
quit | : in out Boolean ) |
procedure Prepend
( | this | : access List; |
element | : Element_Type ); |