CVS difference for ais/ai-10266.txt
--- ais/ai-10266.txt 2003/12/07 05:00:34 1.10
+++ ais/ai-10266.txt 2004/02/12 05:58:55 1.11
@@ -1,4 +1,4 @@
-!standard D.2.2 (5) 03-11-24 AI95-00266-02/05
+!standard D.2.2 (5) 04-02-10 AI95-00266-02/06
!standard D.7 (00)
!class amendment 01-06-01
!status work item 01-06-01
@@ -29,7 +29,7 @@
!wording
-Add new section (not sure where)
+Add new section C.7.3
Task Termination Procedures
@@ -50,50 +50,53 @@
type Handler is access protected procedure(
Cause : Cause_Of_Termination;
T : Ada.Task_Identification.Task_Id;
- X : Ada.Exceptions.Exception_Occurrence :=
- Ada.Exceptions.Null_Occurrence);
+ X : Ada.Exceptions.Exception_Occurrence);
procedure Set_Dependents_Default_Handler(New_Handler: in Handler);
- procedure Get_My_Default_Handler(Current_Handler: out Handler);
+ function Own_Default_Handler(Current_Handler: out Handler);
- procedure Set_Handler(T : Ada.Task_Identification.Task_Id;
+ procedure Set_Specific_Handler(T : Ada.Task_Identification.Task_Id;
New_Handler : in Handler);
- procedure Get_Handler(T : Ada.Task_Identification.Task_Id;
+ function Specific_Handler(T : Ada.Task_Identification.Task_Id;
Current_Handler: out Handler);
-
end Ada.Task_Termination;
Dynamic Semantics
A call of Set_Dependents_Default_Handler sets the default handler
-for all tasks that are directly or indirectly dependent upon the
-calling task. It overrides for these dependent tasks any default
-handler in effect for the calling task. A call of
-Get_My_Default_Handler returns the default handler that is
+for all dependent tasks. If a default handler had previously been
+set it is replaced. A call with a null access parameter is
+equivalent to removing the default handler. A call of
+Own_Default_Handler returns the default handler that is currently
in effect for the calling task. If no default handler has been set
it returns null.
+
+A call of Set_Specific_Handler sets a specific handler for the
+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.
+
+When a task terminates, its specific handler, if not null, is
+executed. If there is no such specific handler, a default handler is
+determined by recursively searching for a non null default handler
+in the tasks upon which it depends. If such a default handler is
+determined it is executed; otherwise no handler is executed.
-A call of Set_Handler sets a specific handler for the task identified
-by T. If a specific handler is already been set it is replaced by
-the new handler. A call of Get_Handler returns the specific handler if one
-has been set, otherwise the handler returned is null.
-
-When a task terminates, as part of its finalization a termination
-handler is identified. If there is a specific handler, it is executed;
-if not a default handler (if one is in effect) is executed.
If the task terminated due to completing the last statement
-of the task body, or as part of waiting on a terminate
-alternative then Cause is set to Normal and no exception id
-is given. If termination is due to abort then Cause is set
-to Abnormal and no exception id is given. If termination is
+of the task body, or as a result of waiting on a terminate
+alternative then Cause is set to Normal and X is set to Null_Occurrence.
+If termination is due to abort then Cause is set
+to Abnormal and X is set to Null_Occurrence. If termination is
due to an unhandled exception then Cause is set to Unhandled_Exception
-and the associated exception occurrence is set.
+and the associated exception occurrence is passed.
For all the operations and types 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 propogated from a handler that is invoked as part of
+An exception propagated from a handler that is invoked as part of
a task's termination has no effect.
!discussion
@@ -194,7 +197,7 @@
end Logger;
begin
Set_Dependents_Default_Handler(Logger.Log_Termination'Access);
- Set_Handler(Current_Task, Logger.Output'Access);
+ Set_Specific_Handler(Current_Task, Logger.Output'Access);
end Termination_Logging;
!discussion
Questions? Ask the ACAA Technical Agent