CVS difference for ais/ai-00297.txt

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

--- ais/ai-00297.txt	2003/06/06 03:00:04	1.7
+++ ais/ai-00297.txt	2003/07/03 04:37:46	1.8
@@ -1,5 +1,8 @@
-!standard D.8 (00)                                     03-03-11  AI95-00297/05
+!standard D.7 (00)                                     03-07-01  AI95-00297/06
+!standard D.15(00)
 !class amendment 02-06-01
+!status Amendment 200Y 03-07-01
+!status ARG Approved 10-0-3  03-07-01
 !status work item 02-06-01
 !status received 02-06-01
 !priority High
@@ -29,70 +32,8 @@
 
 !proposal
 
-A child package of Ada.Real_Time is proposed.
+(See wording.)
 
-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;
-
-private
-  ... -- not specified by the language
-end Ada.Real_Time.Timing_Events;
-
-A call to a Set_Handler procedure returns when the Handler is registered.
-
-At a time no earlier than that implied by the time parameter, the handler
-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 (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.
-
-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 Handler is executed immediately
-by the task executing the Set_Handler call. The rationale for this
-follows from a comparison with delay and delay until that act as
-null operations in these circumstances. An exception raised during
-the execution of a Handler is ignored (c.f. interrupts - C.3(7)).
-
-A call of either Set_Handler procedure is not a potentially suspending
-operation and hence can be called from within a Handler (e.g. a
-Handler can set up a future timing event).
-
-A call to a Set_Handler procedure for a timing event that is already set will
-override the first set operation (i.e. equivalent to making a call to
-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 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
@@ -135,7 +76,7 @@
 
 Dynamic Semantics
 
-A call of either Set_Handler procedure is not a potentially suspending
+A call of either Set_Handler procedure is not a potentially blocking
 operation and hence can be called from within an object of type
 Timing_Event_Handler.
 
@@ -146,9 +87,10 @@
 at the time of execution. Following the execution of the
 Timing_Event_Handler the Timing_Event denoted by Event is cleared.
 
-When a Set_Handler procedure is called, a check is made that the
-ceiling priority of Timing_Event_Handler is Interrupt_Priority'last.
-If the check fails, Program_Error is raised.
+If the Ceiling_Locking policy (see D.3) is in effect when a Set_Handler
+procedure is called, a check is made that the ceiling priority of
+Timing_Event_Handler is Interrupt_Priority'last. If the check fails,
+Program_Error is raised.
 
 If a Set_Handler procedure is called with zero or negative In_Time or with
 At_Time indicating a time in the past then Timing_Event_Handler is
@@ -300,6 +242,153 @@
     Set_Handler(TE, Next_Time, Pulser.Timer'access);
   end Timer;
 end Pulser;
+
+!corrigendum D.7(10)
+
+@dinsa
+@xhang<@xterm<No_Asynchronous_Control>
+There are no semantic dependences on the package Asynchronous_Task_Control.>
+@dinst
+@xhang<@xterm<No_Local_Timing_Events>
+Timing_Events shall be declared only at library level.>
+
+!corrigendum D.13(01)
+@drepl
+@b<pragma> Restrictions (
+                Max_Entry_Queue_Length =@> 1,
+                Max_Protected_Entries =@> 1,
+                Max_Task_Entries =@> 0,
+                No_Abort_Statements,
+                No_Asynchronous_Control,
+                No_Calendar,
+                No_Dynamic_Attachment,
+                No_Dynamic_Priorities,
+                No_Implicit_Heap_Allocations,
+                No_Local_Protected_Objects,
+                No_Protected_Type_Allocators,
+                No_Relative_Delay,
+                No_Requeue_Statements,
+                No_Select_Statements,
+                No_Task_Allocators,
+                No_Task_Attributes_Package,
+                No_Task_Hierarchy,
+                No_Task_Termination,
+                Simple_Barriers);>
+@dby
+@b<pragma> Restrictions (
+                Max_Entry_Queue_Length =@> 1,
+                Max_Protected_Entries =@> 1,
+                Max_Task_Entries =@> 0,
+                No_Abort_Statements,
+                No_Asynchronous_Control,
+                No_Calendar,
+                No_Dynamic_Attachment,
+                No_Dynamic_Priorities,
+                No_Implicit_Heap_Allocations,
+                No_Local_Protected_Objects,
+                No_Local_Timing_Events,
+                No_Protected_Type_Allocators,
+                No_Relative_Delay,
+                No_Requeue_Statements,
+                No_Select_Statements,
+                No_Task_Allocators,
+                No_Task_Attributes_Package,
+                No_Task_Hierarchy,
+                No_Task_Termination,
+                Simple_Barriers);>
+
+
+!corrigendum D.15(01)
+
+@dinsc
+
+This clause introduces a language-defined child package of Ada.Real_Time
+to allow user-defined protected procedures to be executed at a specified
+time without the need to use a task or a delay statement.
+
+@i<@s8<Static Semantics>>
+
+The following language-defined package exists:
+
+@xcode<@b<package> Ada.Real_Time.Timing_Events @b<is>
+  @b<type> Timing_Event @b<is limited private>;
+  @b<type> Timing_Event_Handler
+       @b<is access protected procedure>(Event : @b<in out> Timing_Event);
+  @b<procedure> Set_Handler(Event : @b<in out> Timing_Event;
+            At_Time : @b<in> Time; Handler: @b<in> Timing_Event_Handler);
+  @b<procedure> Set_Handler(Event : @b<in out> Timing_Event;
+            In_Time: @b<in> Time_Span; Handler: @b<in> Timing_Event_Handler);
+  @b<function> Is_Handler_Set(Event : Timing_Event) @b<return> Boolean;
+  @b<function> Current_Handler(Event : Timing_Event)
+           @b<return> Timing_Event_Handler;
+  @b<procedure> Cancel_Handler(Event : @b<in out> Timing_Event;
+            Cancelled : @b<out> Boolean);
+  @b<function> Time_Of_Event(Event : Timing_Event) @b<return> Time;
+@b<private>
+  ... -- not specified by the language
+@b<end> Ada.Real_Time.Timing_Events;>
+
+An object of type Timing_Event is said to be set if it has a
+registered Timing_Event_Handler. An object is said to be cleared
+if it has no registered Timing_Event_Handler. All Timing_Event objects
+are initially cleared.
+
+A call to a Set_Handler procedure returns after the Timing_Event
+denoted by Event is set.
+
+@i<@s8<Dynamic Semantics>>
+
+A call of either Set_Handler procedure is not a potentially blocking
+operation and hence can be called from within an object of type
+Timing_Event_Handler.
+
+Following a call of a Set_Handler procedure, at a time no earlier than
+that specified by the time parameter, the Timing_Event_Handler procedure
+is executed. The rules governing timing accuracy are the same as in D.9.
+The Timing_Event_Handler is only executed if the timing event is set
+at the time of execution. Following the execution of the
+Timing_Event_Handler the Timing_Event denoted by Event is cleared.
+
+If the Ceiling_Locking policy (see D.3) is in effect when a Set_Handler
+procedure is called, a check is made that the ceiling priority of
+Timing_Event_Handler is Interrupt_Priority'last. If the check fails,
+Program_Error is raised.
+
+If a Set_Handler procedure is called with zero or negative In_Time or with
+At_Time indicating a time in the past then Timing_Event_Handler is
+executed immediately by the task executing the Set_Handler call.
+The Timing_Event denoted by Event is cleared.
+
+An exception propagated from a Timing_Event_Handler invoked by
+a timing event has no effect.
+
+A call to a Set_Handler procedure for a Timing_Event that is already
+set will initially cancel the earlier registration.
+The Timing_Event denoted by Event remains set.
+
+A call to Is_Handler_Set returns True if Event is set;
+otherwise it returns False.
+
+A call to Cancel_Handler returns after the Timing_Event denoted by Event
+is cleared. Cancelled is assigned True if Event was set prior to it
+being cleared; otherwise the parameter is assigned False.
+
+A call to Current_Handler returns with the current Timing_Event_Handler.
+If the Timing_Event denoted Event is not set, Current_Handler returns null.
+
+A call to Time_Of_Event returns with the time of Event.
+If Event is not set, Time_Of_Event returns Ada.Real_Time.Time_First.
+
+As the final step of finalization of an object of type Timing_Event,
+the Timing_Event is cleared.
+
+If several timing events are registered for the same time,
+they are executed in FIFO order.
+
+@i<@s8<Implementation Advice>>
+
+The protected handler procedure should be executed directly by the
+real-time clock interrupt mechanism.
 
 
 !ACATS Test

Questions? Ask the ACAA Technical Agent