3 -- Grant of Unlimited Rights
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
7 -- unlimited rights in the software and documentation contained herein.
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
9 -- this public release, the Government intends to confer upon all
10 -- recipients unlimited rights equal to those held by the Government.
11 -- These rights include rights to use, duplicate, release or disclose the
12 -- released technical data and computer software in whole or in part, in
13 -- any manner and for any purpose whatsoever, and to have or permit others
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
25 -- CHECK THAT A NON-MASTER UNIT, WHICH ALLOCATES TASKS OF A GLOBAL
26 -- ACCESS TYPE, MUST TERMINATE WITHOUT WAITING FOR THE ALLOCATED TASKS
27 -- TO TERMINATE IF AN EXCEPTION IS RAISED AND HANDLED IN THE
31 -- (A) A SIMPLE TASK ALLOCATOR, IN A BLOCK.
32 -- (B) A RECORD OF TASK ALLOCATOR, IN A SUBPROGRAM.
33 -- (C) A RECORD OF ARRAY OF TASK ALLOCATOR, IN A TASK BODY.
36 -- JRK 5/1/86 IMPROVED ERROR RECOVERY. FIXED EXCEPTION HANDLING.
37 -- PWN 09/11/94 REMOVED PRAGMA PRIORITY FOR ADA 9X.
40 WITH REPORT
; USE REPORT
;
41 WITH SYSTEM
; USE SYSTEM
;
44 MY_EXCEPTION
: EXCEPTION;
58 TEST
("C94002F", "CHECK THAT A NON-MASTER UNIT, WHICH ALLOCATES " &
59 "TASKS OF A GLOBAL ACCESS TYPE, MUST TERMINATE " &
60 "WITHOUT WAITING FOR THE ALLOCATED TASKS TO " &
61 "TERMINATE IF AN EXCEPTION IS RAISED AND " &
62 "HANDLED IN THE NON-MASTER UNIT");
64 --------------------------------------------------
68 TYPE A_T
IS ACCESS TT
;
80 FAILED
("MY_EXCEPTION WAS NOT RAISED IN (A)");
85 FAILED
("UNEXPECTED EXCEPTION IN (A)");
88 IF A1
.ALL'TERMINATED THEN
89 FAILED
("ALLOCATED TASK PREMATURELY TERMINATED - (A)");
95 --------------------------------------------------
101 FUNCTION F
RETURN INTEGER IS
107 TYPE ART
IS ACCESS RT
;
110 PROCEDURE P
(AR
: OUT ART
) IS
117 FAILED
("MY_EXCEPTION WAS NOT RAISED IN (B)");
122 FAILED
("UNEXPECTED EXCEPTION IN (B)");
128 IF AR1
.T
'TERMINATED THEN
129 FAILED
("ALLOCATED TASK PREMATURELY TERMINATED " &
143 --------------------------------------------------
147 LOOP_COUNT
: INTEGER := 0;
148 CUT_OFF
: CONSTANT := 60; -- DELAY.
156 LOOP_COUNT1
: INTEGER := 0;
157 CUT_OFF1
: CONSTANT := 60; -- DELAY.
160 TYPE ARAT
IS ACCESS RAT
;
161 TYPE ARR
IS ARRAY (1..1) OF TT
;
170 ENTRY ENT1
(ARA
: OUT ARAT
);
176 ARA2
:= NEW RAT
; -- INITIATE TASK ARA2.T(1).
178 ACCEPT ENT1
(ARA
: OUT ARAT
) DO
182 FAILED
("MY_EXCEPTION WAS NOT RAISED IN (C)");
187 FAILED
("UNEXPECTED EXCEPTION IN (C)");
191 TSK1
.ENT1
(ARA1
); -- ARA1.T BECOMES ALIAS FOR ARA2.T.
193 WHILE NOT TSK1
'TERMINATED AND LOOP_COUNT1
< CUT_OFF1
LOOP
194 DELAY 1.0 * Impdef
.One_Second
;
195 LOOP_COUNT1
:= LOOP_COUNT1
+ 1;
198 IF LOOP_COUNT1
>= CUT_OFF1
THEN
199 FAILED
("DEPENDENT TASK TSK1 NOT TERMINATED " &
200 "WITHIN ONE MINUTE - (C)");
203 IF ARA1
.T
(1)'TERMINATED THEN
204 FAILED
("ALLOCATED TASK PREMATURELY TERMINATED " &
212 WHILE NOT TSK
'TERMINATED AND LOOP_COUNT
< CUT_OFF
LOOP
213 DELAY 2.0 * Impdef
.One_Second
;
214 LOOP_COUNT
:= LOOP_COUNT
+ 1;
217 IF LOOP_COUNT
>= CUT_OFF
THEN
218 FAILED
("DEPENDENT TASK TSK NOT TERMINATED WITHIN " &
219 "TWO MINUTES - (C)");
224 ---------------------------------------------------------------