Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Events/Ada/events-1.ada
Normal file
7
Task/Events/Ada/events-1.ada
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
protected type Event is
|
||||
procedure Signal;
|
||||
procedure Reset;
|
||||
entry Wait;
|
||||
private
|
||||
Fired : Boolean := False;
|
||||
end Event;
|
||||
14
Task/Events/Ada/events-2.ada
Normal file
14
Task/Events/Ada/events-2.ada
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
protected body Event is
|
||||
procedure Signal is
|
||||
begin
|
||||
Fired := True;
|
||||
end Signal;
|
||||
procedure Reset is
|
||||
begin
|
||||
Fired := False;
|
||||
end Reset;
|
||||
entry Wait when Fired is
|
||||
begin
|
||||
null;
|
||||
end Wait;
|
||||
end Event;
|
||||
18
Task/Events/Ada/events-3.ada
Normal file
18
Task/Events/Ada/events-3.ada
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Test_Events is
|
||||
-- Place the event implementation here
|
||||
X : Event;
|
||||
|
||||
task A;
|
||||
task body A is
|
||||
begin
|
||||
Put_Line ("A is waiting for X");
|
||||
X.Wait;
|
||||
Put_Line ("A received X");
|
||||
end A;
|
||||
begin
|
||||
delay 1.0;
|
||||
Put_Line ("Signal X");
|
||||
X.Signal;
|
||||
end Test_Events;
|
||||
Loading…
Add table
Add a link
Reference in a new issue