4 -- Grant of Unlimited Rights
6 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
7 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
8 -- unlimited rights in the software and documentation contained herein.
9 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
10 -- this public release, the Government intends to confer upon all
11 -- recipients unlimited rights equal to those held by the Government.
12 -- These rights include rights to use, duplicate, release or disclose the
13 -- released technical data and computer software in whole or in part, in
14 -- any manner and for any purpose whatsoever, and to have or permit others
19 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
20 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
21 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
22 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
23 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
24 -- PARTICULAR PURPOSE OF SAID MATERIAL.
28 -- This file contains foundation code for tests covering the requeue
32 -- See prologues of specific tests.
35 -- 06 Dec 94 SAIC ACVC 2.0
39 package F954A00
is -- Printer device abstraction.
42 -- Model a printer device driver as a protected type. A printer remains
43 -- unavailable while data is printing. The printer generates an interrupt
44 -- when printing is complete, after which the printer is again made
48 type Printers_Info
is tagged record
52 --==============================================--
54 protected type Printers
is -- Device driver for printer.
56 procedure Start_Printing
(File_Name
: String); -- Begin printing on
59 procedure Handle_Interrupt
; -- Handle interrupt from
62 entry Done_Printing
; -- Wait until printer is
65 function Available
return Boolean; -- Return value of Ready.
66 function Is_Done
return Boolean; -- Return value of Done.
70 Ready
: Boolean := True; -- Entry barrier.
71 Done
: Boolean := True; -- Testing flag.
75 --==============================================--
77 Number_Of_Printers
: constant := 2;
79 type Printer_ID
is range 1 .. Number_Of_Printers
;
81 type Printer_Array
is array (Printer_ID
) of Printers
;
82 type Info_Array
is array (Printer_ID
) of Printers_Info
;
84 Printer
: Printer_Array
;
85 Printer_Info
: constant Info_Array
:= ( (Some_Info
=> 1),
91 --==================================================================--
94 package body F954A00
is -- Printer server abstraction.
97 protected body Printers
is
99 procedure Start_Printing
(File_Name
: String) is
101 Ready
:= False; -- Block other requests
102 Done
:= False; -- for this printer
103 -- Send data to the printer... -- and begin printing.
107 -- Set the "not ready" one-shot
108 entry Done_Printing
when Ready
is -- Callers wait here
109 begin -- until printing is
110 Done
:= True; -- done (signaled by a
111 end Done_Printing
; -- printer interrupt).
114 procedure Handle_Interrupt
is -- Called when the
115 begin -- printer interrupts,
116 Ready
:= True; -- indicating that
117 end Handle_Interrupt
; -- printing is done.
120 function Available
return Boolean is -- Artifice for test
121 begin -- purposes: checks
122 return (Ready
); -- whether printer is
123 end Available
; -- still printing.
126 function Is_Done
return Boolean is -- Artifice for test
127 begin -- purposes: checks
128 return (Done
); -- whether Done_Printing
129 end Is_Done
; -- entry was executed.