with Semaphore;
generic
    type Item is private;
    type Priority is limited private;
    with function Priority_Of (The_Item : in Item) return Priority;
    with function "<=" (Left : in Priority; Right : in Priority) return Boolean;
package Queue_Priority_Nonbalking_Concurrent_Unbounded_Managed_Iterator is

    type Queue is limited private;

    procedure Copy (From_The_Queue : in Queue; To_The_Queue : in out Queue);
    procedure Clear (The_Queue : in out Queue);
    procedure Add (The_Item : in Item; To_The_Queue : in out Queue);
    procedure Pop (The_Queue : in out Queue);

    function Is_Equal (Left : in Queue; Right : in Queue) return Boolean;
    function Length_Of (The_Queue : in Queue) return Natural;
    function Is_Empty (The_Queue : in Queue) return Boolean;
    function Front_Of (The_Queue : in Queue) return Item;

    generic
        with procedure Process (The_Item : in Item; Continue : out Boolean);
    procedure Iterate (Over_The_Queue : in Queue);

    Overflow : exception;
    Underflow : exception;

private
    type Node;
    type Structure is access Node;
    type Queue is
        record
            Guard : Semaphore.Kind;
            The_Front : Structure;
            The_Back : Structure;
        end record;
end Queue_Priority_Nonbalking_Concurrent_Unbounded_Managed_Iterator;