CVS difference for ai05s/ai05-0166-1.txt
--- ai05s/ai05-0166-1.txt 2010/02/20 03:39:14 1.2
+++ ai05s/ai05-0166-1.txt 2010/02/23 22:10:40 1.3
@@ -1,4 +1,4 @@
-!standard D.2.1(1.2/2) 10-02-18 AI05-0166-1/02
+!standard D.2.1(1.2/2) 10-02-23 AI05-0166-1/03
!standard D.2.1(6/2)
!standard 9.5.1(16)
!standard D.2.4(2/2)
@@ -84,10 +84,10 @@
The following language-defined library package exists:
-package Ada.Dispatching.Non_Preemptive is
- procedure Yield_To_Higher;
- procedure Yield_To_Same_Or_Higher renames Yield;
-end Ada.Dispatching.Non_Preemptive;
+ package Ada.Dispatching.Non_Preemptive is
+ procedure Yield_To_Higher;
+ procedure Yield_To_Same_Or_Higher renames Yield;
+ end Ada.Dispatching.Non_Preemptive;
A call of Yield_To_Higher is a task dispatching point for this policy. If the
task at the head of the highest priority ready queue has a higher active
@@ -109,8 +109,27 @@
Capability and Flexibility for Ada 2005, by Rod White.
!example
+
+A task that iterates through an algorithm, but offers to be preempted
+by a higher priority task after each iteration would take the form:
+
+ with Ada.Dispatching.Non_Preemptive;
+ ...
+
+ task Iterator;
-** TBD **
+ task body Iterator is
+ ...
+ Improving : boolean := True;
+ begin
+ ...
+ while Improving loop
+ -- code to improve quality of control
+ -- might set improving to false
+ Ada.Dispatching.Non_Preemptive.Yield_To_Higher;
+ end loop;
+ ...
+ end Iterator;
--!corrigendum D.2.4(9/2)
Questions? Ask the ACAA Technical Agent