-- ada tasking tester
-- task head is the controller
-- tasks link are the chain of tasks

with Instrument;
use Instrument;

procedure Tpsta2 is

    task Head is
        entry Give;
    end Head;
    task Link1 is
        entry Give;
        entry S2;
    end Link1;
    task body Head is
    begin
        Start ("TPSTA2", "Task Perf., Select test (test)");
        for I in 1 .. 1000 loop
            Link1.Give;
            accept Give do
                null;
            end Give;
        end loop;
        Stop;
        abort Link1;
    end Head;
    task body Link1 is
    begin
        loop
            select
                accept Give do
                    null;
                end Give;
            or
                accept S2 do
                    null;
                end S2;
            end select;
            Head.Give;
        end loop;
    end Link1;
begin
    null;
end Tpsta2;