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

with Instrument;
use Instrument;

procedure Tpgta2 is

    G1 : Boolean := True;
    G2 : Boolean := False;
    task Head is
        entry Give;
    end Head;
    task Link1 is
        entry Give;
        entry S2;
    end Link1;
    task body Head is
    begin
        Start ("TPGTA2", "Task Perf., Guard Test, 2 guards (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
                when G1 =>
                    accept Give do
                        null;
                    end Give;
            or
                when G2 =>
                    accept S2 do
                        null;
                    end S2;
            end select;
            Head.Give;
        end loop;
    end Link1;
begin
    null;
end Tpgta2;