pragma Task_Dispatching_Policy(FIFO_Within_Priorities); pragma Locking_Policy (Ceiling_Locking); with Ada.Real_Time; use Ada.Real_Time; with Ada.Dynamic_Priorities; use Ada.Dynamic_Priorities; -- with Rtl_Pt1; -- use Rtl_Pt1; procedure dyn_prior is task T1 is pragma Priority(20); end T1; task T2 is pragma Priority(15); end T2; task T3 is pragma Priority(10); end T3; protected Protected_Object is pragma Priority (18); procedure Write; end Protected_Object; protected body Protected_Object is procedure Write is Next_While: Time; Period_While : Time_Span := Microseconds(40); begin Next_While := Clock + Period_While; while Clock < Next_While loop null; end loop; end Write; end Protected_Object; task body T1 is Next : Time; Period : Time_Span := Microseconds (500); begin Next := Clock; loop delay until Next; Next := Next + Period; Set_Priority(15, T2'Identity); delay until Next; Next := Next + Period; Set_Priority(5, T2'Identity); end loop; end T1; task body T2 is Next : Time; Period : Time_Span := Microseconds (300); begin Next := Clock; loop delay until Next; Next := Next + Period; Protected_Object.Write; end loop; end T2; task body T3 is Next : Time; Period : Time_Span := Microseconds(150); Next_While: Time; Period_While : Time_Span := Microseconds(20); begin Next := Clock; loop delay until Next; Next := Next + Period; Next_While := Clock + Period_While; while Clock < Next_While loop null; end loop; end loop; end T3; -- Res: Integer; begin -- Res := Integer(Rtl_Ktrace_start); delay 0.5; -- Res := Integer(Rtl_Ktrace_stop); end Dyn_prior;