1 -- Copyright 2009-2023 Free Software Foundation, Inc.
3 -- This program is free software; you can redistribute it and/or modify
4 -- it under the terms of the GNU General Public License as published by
5 -- the Free Software Foundation; either version 3 of the License, or
6 -- (at your option) any later version.
8 -- This program is distributed in the hope that it will be useful,
9 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
10 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 -- GNU General Public License for more details.
13 -- You should have received a copy of the GNU General Public License
14 -- along with this program. If not, see <http://www.gnu.org/licenses/>.
25 type Caller_Ptr
is access Caller
;
37 accept Call_Break_Me
do
45 Task_List
: array (1 .. 3) of Caller_Ptr
;
49 -- Start all our tasks, and call the "Initialize" entry to make
50 -- sure all of them have now been started. We call that entry
51 -- immediately after having created the task in order to make sure
52 -- that we wait for that task to be created before we try to create
53 -- another one. That way, we know that the order in our Task_List
54 -- corresponds to the order in the GNAT runtime.
55 for J
in Task_List
'Range loop
56 Task_List
(J
) := new Caller
;
57 Task_List
(J
).Initialize
;
60 -- Next, call their Call_Break_Me entry of each task, using the same
61 -- order as the order used to create them.
62 for J
in Task_List
'Range loop -- STOP_HERE
63 Task_List
(J
).Call_Break_Me
;
66 -- And finally, let all the tasks die...
67 for J
in Task_List
'Range loop
68 Task_List
(J
).Finalize
;