home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / prog1 / ada-tutr.lzh / TASKING.ANS (.png) < prev    next >
ANSI Art File  |  1988-12-21  |  2KB  |  640x752  |  1-bit (2 colors)
Labels: text | screenshot | font
OCR: Our solution to Outside Assignment 6: with text_io, calendar; use text_io, calendar; procedure tasking is interval : constant duration := 5.0; total_intervals : constant positive := 9; start_time quitting_time constant time := clock; : constant time := start_time total_intervals*interval; next_time : time := start_time; task type tick is ENTRY IDENTIFY (TASK_NUMBER : IN NATURAL ); entry shutdown; end tick; T : ARRAY(1 .. 3) OF TICK; PERIOD CONSTANT ARRAY (T'RANGE) OF POSITIVE := (2, 3, 4); TIMER : ARRAY(T'RANGE) OF NATURAL := (OTHERS => 0); task body tick is quit : boolean := false; begin while not quit loop select ACCEPT IDENTIFY ( TASK_NUMBER : IN NATURAL ) DO PUT_LINE ( "Task number" & INTEGER' IMAGE ( TASK_NUMBER) & is starting. "); END IDENTIFY; or accept shutdown; quit := true; end s ...