pragma Task_Dispatching_Policy (FIFO_Within_Priorities); pragma Locking_Policy (Ceiling_Locking); with Ada.Real_Time; use Ada.Real_Time; procedure Ceiling_ex is task T1 is pragma Priority (16); end T1; task T2 is pragma Priority (17); end T2; task T3 is pragma Priority (18); end T3; protected Obj is procedure Write; end Obj; protected body Obj is procedure Write is Next : Time; Period : Time_Span := Microseconds (300); begin Next := Clock + Period; while Next > Clock loop null; end loop; end Write; end obj; task body T1 is Next : Time; Period : Time_Span := Microseconds (800); begin Next := Clock + Period; loop Obj.Write; delay until Next; Next := Next + Period; end loop; end T1; task body T2 is Next : Time; Period : Time_Span := Milliseconds (2); Next_While : Time; Period_While : Time_Span := Microseconds(500); begin Next := Clock + Period; loop Next_While := Clock + Period_While; While (Next_While > Clock) loop null; end loop; delay until Next; Next := Next + Period; end loop; end T2; task body T3 is Next : Time; Period : Time_Span := Microseconds (750); Next_While : Time; Period_While : Time_Span := Microseconds(200); begin Next := Clock + Period; loop Next_While := Clock + Period_While; While (Next_While > Clock) loop null; end loop; delay until Next; Next := Next + Period; end loop; end T3; begin null; end Ceiling_ex;