Guest User

Untitled

a guest
Jun 3rd, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 0.57 KB | None | 0 0
  1. with world;
  2. with ada.Text_IO;
  3. use ada.Text_IO;
  4.  
  5. package world is
  6.  
  7.    procedure FixWorld(i : Integer);
  8.    
  9.    task type A is
  10.       entry E;
  11.    end;  
  12. end;
  13.  
  14. package body world is
  15.    
  16.    procedure FixWorld(i : Integer) is
  17.    begin
  18.       delay 10.0;
  19.    end;
  20.    
  21.    task body A is
  22.    begin
  23.       FixWorld(10);
  24.       accept E;
  25.    end;
  26.  
  27. end;
  28.  
  29. procedure gmain is
  30.    atask : world.A;
  31. begin
  32.    Put_Line("start");
  33.    select
  34.       atask.E;
  35.    or
  36.       delay 5.0;
  37.       abort atask;
  38.       Put_Line("przerwa");
  39.    end select;
  40.    Put_Line("end");
  41. end;
Add Comment
Please, Sign In to add comment