with System; with Ada.Text_IO; procedure Russ is package P is type Parent is synchronized interface; function Is_Safe (P : Parent) return Boolean is abstract; procedure Set_Safety (P : in out Parent; To : Boolean) is abstract; protected type Child (Ceiling : System.Priority) with Priority => Ceiling is new Parent with overriding function Is_Safe return Boolean; overriding procedure Set_Safety (To : Boolean); private Safety : Boolean := False; end Child; end P; package body P is protected body Child is function Is_Safe return Boolean is (Safety); procedure Set_Safety (To : Boolean) is begin Safety := To; end Set_Safety; end Child; end P; A_Child : P.Child (Ceiling => System.Priority'Last); begin Ada.Text_IO.Put_Line (A_Child.Is_Safe'Img); A_Child.Set_Safety (True); Ada.Text_IO.Put_Line (A_Child.Is_Safe'Img); end Russ;