Yurttas/PL/IL/Ada-95/F/06/trains/trains 00.adb

 1--
 2-- Copyright(C) 1998
 3-- All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4--
 5-- Permission to use, copy, modify, and distribute this
 6-- software and its documentation for EDUCATIONAL purposes
 7-- and without fee is hereby granted provided that this
 8-- copyright notice appears in all copies.
 9--
10 
11-- date   : January 1, 1998.
12-- authorĀ : Salih Yurttas.
13
14-- trains_00.adb
15
16
17with Ada.Text_IO;
18use Ada.Text_IO;
19
20procedure Trains_00 is
21
22  procedure Approach_Points is
23  begin
24    Put_Line("...Approach_Points");
25  end Approach_Points;
26
27  procedure Cross_Points is
28  begin
29    Put_Line("   Cross_Points");
30  end Cross_Points;
31
32  procedure Go_Away_From_Points is
33  begin
34    Put_Line("   Go_Away_From_Points...");
35  end Go_Away_From_Points;
36
37  task Points is
38    entry Enter;
39    entry Leave;
40  end Points;
41
42  task body Points is
43  begin
44    loop
45      accept Enter;
46      accept Leave;
47    end loop;
48  end Points;
49
50  task Train1;
51
52  task body Train1 is
53  begin
54    Approach_Points;
55    Points.Enter;
56    Cross_Points;
57    Points.Leave;
58    Go_Away_From_Points;
59  end Train1;
60
61  task Train2;
62
63  task body Train2 is
64  begin
65    Approach_Points;
66    Points.Enter;
67    Cross_Points;
68    Points.Leave;
69    Go_Away_From_Points;
70  end Train2;
71
72begin
73
74  null;
75
76end Trains_00;