CVS difference for ais/ai-00250.txt

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

--- ais/ai-00250.txt	2000/12/22 00:23:08	1.4
+++ ais/ai-00250.txt	2001/05/11 03:46:21	1.5
@@ -1,4 +1,4 @@
-!standard 09.04    (05)                            00-12-13  AI95-00250/02
+!standard 09.04    (05)                            01-04-29  AI95-00250/03
 !standard 09.05.02 (02)
 !standard 09.05.03 (02)
 !class amendment 00-12-04
@@ -447,10 +447,11 @@
 entries, having neither barriers nor bodies, could still be
 overridden without problems.)
 
-Furthermore, *this* proposal assumes that the added complexity
-is (a) not that much (in particular, there still is only *one*
-mutex per protected object, and only *one* queue per entry),
-and (b) is worthwhile because it leads to a much more complete
+This proposal assumes that the added complexity is
+(a) not that much (in particular, there still is a single
+mutex per protected object, and a single queue per entry),
+and
+(b) is worthwhile because it leads to a much more complete
 solution. (Albeit it doesn't fully solve all difficulties...)
 Also, it is felt that the addition of ancestor entry calls is
 not a big additional complexity, given that barriers must be
@@ -476,8 +477,6 @@
 
 !example
 
-[This is from Tucker's version: it should have been updated - ED]
-
 Examples based on May 2000 TOPLAS article
 
 Signal Example:
@@ -505,6 +504,8 @@
 package Signals.Persistent is
     protected type Persistent_Signal is new Signal with
         entry Wait;
+    private
+        entry wait when Signal_Arrived;
     end Persistent_Signal;
 end Signals.Persistent;
 package body Signals.Persistent is
@@ -522,6 +523,8 @@
     protected type Transient_Signal is new Signal with
         procedure Send;
         entry Wait;
+    private
+        entry wait when Signal_Arrived;
     end Transient_Signal;
 end Signals.Transient;
 package body Signals.Transient is
@@ -564,9 +567,13 @@
         entry Hold;
         entry Resume;
     private
-        Free : Natural := Max_Resources_Available;
-        Taken : Natural := 0;
+        Free   : Natural := Max_Resources_Available;
+        Taken  : Natural := 0;
         Locked : Boolean := False;
+
+        entry Allocate when Free > 0 and not Locked and Hold'Count = 0;
+        entry Hold     when not Locked;
+        entry Resume   when Locked;
     end Simple_Resource_Controller;
 end Rsc_Controller;
 
@@ -575,7 +582,7 @@
         entry Allocate when Free > 0 and not Locked and
             Hold'Count = 0 is
         begin
-            Free := Free -1; -- allocate resource
+            Free  := Free -1; -- allocate resource
             Taken := Taken + 1;
         end Allocate;
         procedure Deallocate is
@@ -622,6 +629,15 @@
         -- time outstanding calls to these routines have been serviced.
         -- 'Changed' actually encodes the history information 'Wait_For_N'
         -- is only accepted after a call to 'Deallocate'.
+        entry Allocate_N( N: Natural)
+                 and when Free > 0 and not Locked and Hold'Count = 0;
+        entry Wait_For_N (for Queue in Boolean)(N : in Natural)
+                 when not Locked and Hold'Count = 0
+                                 and Queue = Current_Count
+                                 and Changed;
+        -- The entry guard evaluation is separate from the entry
+        -- specification since the specification for the guard
+        -- evaluation must express the family in terms of local variables.
     end Advanced_Resource_Controller;
 end Rsc_Controller.Advanced;
 
@@ -634,8 +650,8 @@
             Changed := True;
             Simple_Resource_Controller.Deallocate;
         end Deallocate;
-        entry Allocate_N (N : in Natural) when
-          Free > 0 and not Locked and Hold'Count = 0 is
+        entry Allocate_N (N : in Natural)
+          and when Free > 0 and not Locked and Hold'Count = 0 is
         begin
             if Free >= N then
                 Free := Free - N;

Questions? Ask the ACAA Technical Agent