package Q is procedure Read(S : out Integer); procedure Restore(S : in out Integer); end Q; package P is type Int_Ptr is access all Integer; procedure Exec(P : Int_Ptr); end P; with Q; use Q; package body P is procedure Lock is S : Integer; begin Read(S); Restore(S); exception when others => Restore(S); end; procedure Exec(P : Int_Ptr) is begin while P /= NULL loop Lock; end loop; end; end P;