1-- C97203A.ADA
2
3--                             Grant of Unlimited Rights
4--
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
14--     to do so.
15--
16--                                    DISCLAIMER
17--
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.
24--*
25-- CHECK THAT A CONDITIONAL_ENTRY_CALL CAN APPEAR IN PLACES WHERE A
26--     SELECTIVE_WAIT  CANNOT.
27
28-- PART 1: PACKAGE BODY EMBEDDED IN TASK BODY.
29
30
31-- RM 4/01/1982
32
33
34WITH REPORT;
35USE REPORT;
36PROCEDURE  C97203A  IS
37
38
39BEGIN
40
41
42     TEST ( "C97203A" , "CHECK THAT A  CONDITIONAL_ENTRY_CALL  CAN" &
43                        " APPEAR WHERE A  SELECTIVE_WAIT  CANNOT" );
44
45
46     -------------------------------------------------------------------
47
48
49     DECLARE
50
51
52          TASK  TT  IS
53               ENTRY  A ( AUTHORIZED : IN BOOLEAN );
54          END  TT ;
55
56
57          TASK BODY  TT  IS
58
59
60               PACKAGE  WITHIN_TASK_BODY  IS
61                    -- NOTHING HERE
62               END  WITHIN_TASK_BODY ;
63
64
65               PACKAGE BODY  WITHIN_TASK_BODY  IS
66               BEGIN
67
68                    SELECT  -- NOT A SELECTIVE_WAIT
69                         A ( FALSE ) ;  -- CALLING (OWN) ENTRY
70                    ELSE
71                         COMMENT( "ALTERNATIVE BRANCH TAKEN" );
72                    END SELECT;
73
74               END  WITHIN_TASK_BODY ;
75
76
77          BEGIN
78
79               ACCEPT  A ( AUTHORIZED : IN BOOLEAN )  DO
80
81                    IF  AUTHORIZED  THEN
82                         COMMENT(  "AUTHORIZED ENTRY_CALL" );
83                    ELSE
84                         FAILED( "UNAUTHORIZED ENTRY_CALL" );
85                    END IF;
86
87               END  A ;
88
89          END  TT ;
90
91
92          PACKAGE  OUTSIDE_TASK_BODY  IS
93               -- NOTHING HERE
94          END  OUTSIDE_TASK_BODY ;
95
96
97          PACKAGE BODY  OUTSIDE_TASK_BODY  IS
98          BEGIN
99
100               SELECT  -- NOT A SELECTIVE_WAIT
101                    TT.A ( FALSE ) ;  -- UNBORN
102               ELSE
103                    COMMENT( "(OUT:) ALTERNATIVE BRANCH TAKEN" );
104               END SELECT;
105
106          END  OUTSIDE_TASK_BODY ;
107
108
109     BEGIN
110
111          TT.A ( TRUE );
112
113     EXCEPTION
114
115          WHEN  TASKING_ERROR  =>
116               FAILED( "TASKING ERROR" );
117
118     END  ;
119
120     -------------------------------------------------------------------
121
122     RESULT ;
123
124
125END  C97203A ;
126