CVS difference for ais/ai-00297.txt

Differences between 1.4 and version 1.5
Log of other versions for file ais/ai-00297.txt

--- ais/ai-00297.txt	2003/01/02 23:58:28	1.4
+++ ais/ai-00297.txt	2003/01/16 01:37:01	1.5
@@ -1,4 +1,4 @@
-!standard D.8 (00)                                     02-09-05  AI95-00297/02
+!standard D.8 (00)                                     03-01-07  AI95-00297/03
 !class amendment 02-06-01
 !status work item 02-06-01
 !status received 02-06-01
@@ -48,7 +48,8 @@
 
   function Current_Handler(TE : Timing_Event) return Timing_Event_Handler;
 
-  procedure Cancel_Handler(TE : in out Timing_Event);
+  procedure Cancel_Handler(TE : in out Timing_Event;
+             Cancelled : out Boolean);
 
   function Time_Of_Event(TE : Timing_Event) return Time;
 
@@ -57,7 +58,8 @@
 end Ada.Real_Time.Timing_Events;
 
 The protected procedure corresponding to the Timing_Event_Handler
-must be a library level definition.
+must be a library level definition. Alternatively pragma No_Deeper_Objects
+could be used.
 
 A call to a Set_Handler procedure returns when the Handler is registered.
 
@@ -65,7 +67,7 @@
 procedure is executed. The detailed rules governing timing accuracy are the
 same as D.9. The assumption is that the procedure may be executed by the
 real-time clock interrupt mechanism. Hence the ceiling priority of the
-protected procedure (Parameterless_Handler) must be interrupt_priority'last.
+protected procedure (Timing_Event_Handler) must be interrupt_priority'last.
 It is a bounded error to use a protected procedure with a priority less than
 interrupt_priority'last.
 
@@ -85,15 +87,90 @@
 Cancel_Handle first).
 
 A call to Is_Handler_Set following a call to Cancel_Handler for the
-same timing_event will return false. A call to Cancel_Handler will
-have no effect if the timing event is not set. A call to Current_Handler
-for a timing event that is not set will return null. A call to
-Time_Of_Event for a timing event that is not set will return Time_First.
+same timing_event will return false. A call to Cancel_Handler returns
+with Cancelled set to True if the event was set prior to it been
+cancelled; otherwise the parameter is set to False and the call
+has no effect. A call to Current_Handler for a timing event that
+is not set will return null. A call to Time_Of_Event for a timing
+event that is not set will return Time_First.
 
 A number of timing events registered for the same time will execute in FIFO
 order. Note, all will be executed before any other application code.
 
 !wording
+
+Add new section D.15
+
+D.15 Timing Events
+
+This clause introduces a language-defined child package of Ada.Real_Time
+to allow user-defined procedures to be executed at a specified time without
+the need to use a task or a delay statement.
+
+Static Symantics
+
+The following language-defined package exists:
+
+package Ada.Real_Time.Timing_Events is
+  type Timing_Event is limited private;
+  type Timing_Event_Handler
+       is access protected procedure(TE : in out Timing_Event);
+  procedure Set_Handler(TE : in out Timing_Event; At_Time : in Time;
+            Handler: in Timing_Event_Handler);
+  procedure Set_Handler(TE : in out Timing_Event; In_Time: in Time_Span;
+            Handler: in Timing_Event_Handler);
+  function Is_Handler_Set(TE : Timing_Event) return Boolean;
+  function Current_Handler(TE : Timing_Event) return Timing_Event_Handler;
+  procedure Cancel_Handler(TE : in out Timing_Event;
+            Cancelled : out Boolean);
+  function Time_Of_Event(TE : Timing_Event) return Time;
+  pragma No_Deeper_Objects(Timing_Event);
+private
+  ... -- not specified by the language
+end Ada.Real_Time.Timing_Events;
+
+A call to a Set_Handler procedure returns when the timing event is set.
+
+A call of either Set_Handler procedure is not a potentially suspending
+operation and hence can be called from within a Timing_Event_Handler.
+
+Dynamic Semantics
+
+At a time no earlier than that implied by the time parameter, the
+Timing_Event_Handler procedure is executed. The rules governing timing
+accuracy are the same as in D.9.
+
+It is a bounded error to use a protected procedure for the
+Timing_Event_Handler with a priority less than Interrupt_Priority'last.
+
+If a Set_Handler procedure is called with zero or negative In_Time or with
+At_time indicating a time in the past then the Timing_Event_Handler is
+executed immediately by the task executing the Set_Handler call.
+
+An exception raised during the execution of a Timing_Event_Handler is ignored
+(see C.3, "Interrupt Support").
+
+A call to a Set_Handler procedure for a timing event that is already set will
+override the first set operation.
+
+A call to Is_Handler_Set returns false if the timing event is not set;
+otherwise it return True.
+
+A call to Cancel_Handler returns with Cancelled set to True if the
+event was set prior to it been cancelled; otherwise the parameter is
+set to False and the call has no effect.
+
+A call to Current_Handler for a timing event that is not set will
+return null. A call to Time_Of_Event for a timing event that is not
+set will return Ada.Real_Time.Time_First.
+
+A number of timing events registered for the same time execute in FIFO
+order.
+
+Implementation Advice
+
+The protected handler procedure should be executed directly by the
+real-time clock interrupt mechanism.
 
 !discussion
 

Questions? Ask the ACAA Technical Agent