CVS difference for ais/ai-10266.txt

Differences between 1.13 and version 1.14
Log of other versions for file ais/ai-10266.txt

--- ais/ai-10266.txt	2004/07/27 23:01:08	1.13
+++ ais/ai-10266.txt	2004/11/14 06:37:22	1.14
@@ -1,4 +1,4 @@
-!standard D.2.2 (5)                                04-06-25  AI95-00266-02/07
+!standard D.2.2 (5)                                04-11-09  AI95-00266-02/08
 !standard D.7 (00)
 !class amendment 01-06-01
 !status Amendment 200Y 04-06-25
@@ -15,10 +15,7 @@
 with a task. This procedure is invoked when the task is about to terminate
 (either normally, as a result of an unhandled exception or due to abort).
 If a task terminates due to an unhandled exception, the exception occurrence
-is passed as a parameter to the procedure. The proposal provides an alternative
-to that of AI95-00266-01 which was rejected by IRTAW11; it responds to earlier
-comments by the ARG. The proposal here introduces fall-back handlers for task
-hierarchies, but does not go as far as task groups.
+is passed as a parameter to the procedure.
 
 !problem
 
@@ -49,18 +46,18 @@
 package Ada.Task_Termination is
   type Cause_Of_Termination is (Normal, Abnormal, Unhandled_Exception);
 
-  type Handler is access protected procedure(
+  type Termination_Handler is access protected procedure(
       Cause : in Cause_Of_Termination;
       T : in Ada.Task_Identification.Task_Id;
       X : in Ada.Exceptions.Exception_Occurrence);
 
-  procedure Set_Dependents_Fallback_Handler(New_Handler: in Handler);
-  function Current_Task_Fallback_Handler return Handler;
+  procedure Set_Dependents_Fallback_Handler(Handler: in Termination_Handler);
+  function Current_Task_Fallback_Handler return Termination_Handler;
 
   procedure Set_Specific_Handler(T : in Ada.Task_Identification.Task_Id;
-                        New_Handler : in Handler);
+                        Handler : in Termination_Handler);
   function Specific_Handler(T : Ada.Task_Identification.Task_Id)
-      return Handler;
+      return Termination_Handler;
 end Ada.Task_Termination;
 
 Dynamic Semantics
@@ -77,13 +74,12 @@
 task identified by T. If a specific handler had previously been set
 it is replaced. A call with a null access parameter is equivalent
 to removing the specific handler. A call of Specific_Handler returns
-the specific handler if one has been set, otherwise the handler
-returned is null.
+the specific handler if one has been set, otherwise it returns null.
 
 As part of the finalization of a task_body, after performing the actions
 specified in 7.6 for finalization of a master, the task specific handler,
 if not null, is called. If there is no such specific handler, a fall-back
-handler is determined by recursively searching for a non null fall-back
+handler is determined by recursively searching for a non-null fall-back
 handler in the tasks upon which it depends. If such a fall-back handler
 is determined it is executed; otherwise no handler is executed.
 
@@ -93,20 +89,20 @@
 If completion is due to abort then Cause is set
 to Abnormal and X is set to Null_Occurrence. If completion is
 due to an unhandled exception then Cause is set to Unhandled_Exception
-and the associated exception occurrence is passed.
+and X is set to the associated exception occurrence.
 
 For all the operations defined in this package, Tasking_Error
 is raised if the task identified by T has already terminated. Program_Error
 is raised if the value of T is Null_Task_ID.
 
 An exception propagated from a handler that is invoked as part of
-a task's termination has no effect.
+the termination of a task has no effect.
 
 !discussion
 
 Many safety critical and high integrity systems prohibit (or discourage)
 exception handling, and so the use of a "when others" handler at the
-outer most level of the task body level is then not available.
+outermost level of the task body is then not available.
 Furthermore, there may be many tasks in a system, and a systematic,
 centralized way of handling unhandled exceptions is preferred to having
 to repeat code in every task body. The proposed solution is applicable
@@ -145,11 +141,16 @@
 task. Consequently, if Task_Identification.Current_Task is called from the
 handler, the terminating task identifier is returned.
 
+Note: This proposal provides an alternative
+to that of AI95-00266-01 which was rejected by IRTAW11; it responds to earlier
+comments by the ARG. The proposal here introduces fall-back handlers for task
+hierarchies, but does not go as far as task groups.
+
 !example
 
 The following example illustrates how the mechanisms can be used.
 
-The example is of a library package that logs the termination of all tasks and,
+The example is a library package that logs the termination of all tasks and,
 separately, the terminations due to unhandled exceptions. It also releases
 a guardian task if any task fails due to being aborted. At the end of
 the program (when the environment task wishes to terminate) the logged
@@ -222,19 +223,19 @@
 @b<package> Ada.Task_Termination @b<is>
   @b<type> Cause_Of_Termination @b<is> (Normal, Abnormal, Unhandled_Exception);
 
-  @b<type> Handler @b<is access protected procedure>(
+  @b<type> Termination_Handler @b<is access protected procedure>(
       Cause : @b<in> Cause_Of_Termination;
       T     : @b<in> Ada.Task_Identification.Task_Id;
       X     : @b<in> Ada.Exceptions.Exception_Occurrence);
 
-  @b<procedure> Set_Dependents_Fallback_Handler(New_Handler: @b<in> Handler);
-  @b<function> Current_Task_Fallback_Handler return Handler;
+  @b<procedure> Set_Dependents_Fallback_Handler(Handler: @b<in> Termination_Handler);
+  @b<function> Current_Task_Fallback_Handler return Termination_Handler;
 
   @b<procedure> Set_Specific_Handler(
       T           : @b<in> Ada.Task_Identification.Task_Id;
-      New_Handler : @b<in> Handler);
+      Handler     : @b<in> Termination_Handler);
   function Specific_Handler(T : Ada.Task_Identification.Task_Id)
-      @b<return> Handler;
+      @b<return> Termination_Handler;
 @b<end> Ada.Task_Termination;>
 
 @i<@s8<Dynamic Semantics>>
@@ -251,13 +252,13 @@
 task identified by T. If a specific handler had previously been set
 it is replaced. A call with a null access parameter is equivalent
 to removing the specific handler. A call of Specific_Handler returns
-the specific handler if one has been set, otherwise the handler
-returned is null.
+the specific handler if one has been set, otherwise the handler it
+returns null.
 
-As part of the finalization of a task_body, after performing the actions
+As part of the finalization of a @fa<task_body>, after performing the actions
 specified in 7.6 for finalization of a master, the task specific handler,
 if not null, is called. If there is no such specific handler, a fall-back
-handler is determined by recursively searching for a non null fall-back
+handler is determined by recursively searching for a non-null fall-back
 handler in the tasks upon which it depends. If such a fall-back handler
 is determined it is executed; otherwise no handler is executed.
 
@@ -267,14 +268,14 @@
 If completion is due to abort then Cause is set
 to Abnormal and X is set to Null_Occurrence. If completion is
 due to an unhandled exception then Cause is set to Unhandled_Exception
-and the associated exception occurrence is passed.
+and X is set to the associated exception occurrence.
 
 For all the operations defined in this package, Tasking_Error
 is raised if the task identified by T has already terminated. Program_Error
 is raised if the value of T is Null_Task_ID.
 
 An exception propagated from a handler that is invoked as part of
-a task's termination has no effect.
+the termination of a task has no effect.
 
 !ACATS test
 

Questions? Ask the ACAA Technical Agent