Commit 50fd0959 authored by hugues.jerome's avatar hugues.jerome Committed by yoogx

* Add an observer to check the user code is not overloading us


git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-ada@958 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent af1d6d71
......@@ -48,6 +48,7 @@ package body PolyORB_HI.Periodic_Task is
task body The_Periodic_Task is
Next_Start : Ada.Real_Time.Time;
T : Ada.Real_Time.Time;
Error : Error_Kind;
begin
......@@ -86,6 +87,15 @@ package body PolyORB_HI.Periodic_Task is
Recover_Entrypoint;
end if;
T := Ada.Real_Time.Clock;
if T > Next_Start then
Put_Line (Normal, "***** Overload detected *****");
Put_Line (Normal, "Lag: " &
Duration'Image (To_Duration (Next_Start - T)));
raise Program_Error;
end if;
delay until Next_Start;
Next_Start := Next_Start + Task_Period;
Next_Deadline_Val := Ada.Real_Time.Clock + Task_Deadline;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment