|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 3072 (0xc00) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Fifo, seg_02422c
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
package body Fifo is Tab : array (1 .. Size) of Element; Head, Tail : Positive := 1; task body Task_Fifo is begin loop select accept Get (Item : out Element; Result : out Boolean) do if not Is_Empty then Get (Item); Result := True; else Result := False; end if; end Get; or accept Put (Item : in Element; Result : out Boolean) do if not Is_Full then Put (Item); Result := True; else Result := False; end if; end Put; or accept Clear do Clear; end Clear; or terminate; end select; end loop; end Task_Fifo; procedure Clear is begin Head := 1; Tail := 1; end Clear; function Is_Empty return Boolean is begin return Head = Tail; end Is_Empty; function Is_Full return Boolean is begin return Tail + 1 mod Size = Head; end Is_Full; procedure Get (Item : out Element) is begin Item := Tab (Head); if Head = Size then Head := 1; else Head := Head + 1; end if; end Get; procedure Put (Item : in Element) is begin Tab (Tail) := Item; if Tail = Size then Tail := 1; else Tail := Tail + 1; end if; end Put; end Fifo;
nblk1=2 nid=0 hdr6=4 [0x00] rec0=24 rec1=00 rec2=01 rec3=034 [0x01] rec0=30 rec1=00 rec2=02 rec3=001 tail 0x2151ec6c6839c4a4f542a 0x42a00088462060003