summaryrefslogtreecommitdiffstats
path: root/gcc/ada/a-rttiev.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 18:14:09 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 18:14:09 +0000
commit4ad0f27710ed8a9d320b9f976e0baa8854b56bc9 (patch)
tree8d996a610392ed685d80543ddaa0be48ff5f097a /gcc/ada/a-rttiev.ads
parent6059d0f96a6002445b48b5bf54865af29d29db7a (diff)
downloadppe42-gcc-4ad0f27710ed8a9d320b9f976e0baa8854b56bc9.tar.gz
ppe42-gcc-4ad0f27710ed8a9d320b9f976e0baa8854b56bc9.zip
2006-10-31 Pat Rogers <rogers@adacore.com>
* a-rttiev.ads, a-rttiev.adb: This is a significant redesign primarily for the sake of automatic timer task termination but also to fix a design flaw. Therefore we are now using an RTS lock, instead of a protected object, to provide mutual exclusion to the queue of pending events and the type Timing_Event is no longer a protected type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118327 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-rttiev.ads')
-rw-r--r--gcc/ada/a-rttiev.ads47
1 files changed, 1 insertions, 46 deletions
diff --git a/gcc/ada/a-rttiev.ads b/gcc/ada/a-rttiev.ads
index 9d114d4f598..19274bcebf2 100644
--- a/gcc/ada/a-rttiev.ads
+++ b/gcc/ada/a-rttiev.ads
@@ -65,42 +65,7 @@ package Ada.Real_Time.Timing_Events is
private
- protected type Event_State is
-
- -- D.15 (22/2) requires atomicity with respect to the operations
- -- provided by the package and the timing events they manipulate. On
- -- real-time operating systems suitable for implementing this package, a
- -- different implementation strategy would be employed to meet that
- -- requirement.
-
- entry Set (Timeout : Time; Handler : Timing_Event_Handler);
- -- Changes the timeout and handler values for procedure Set_Handler. Can
- -- only execute when the event is 'available', to prevent a race
- -- condition between the caller of Set_Handler and the internal Timer
- -- task that processes the events. In particular, D.15 (22/2) requires
- -- that there be no possibility of a new handler executing in response
- -- to an old timeout.
-
- procedure Reset;
- -- First resets the timeout to Time_First and the handler to
- -- null. Indicates that Set (for Set_Handler) can now change the timeout
- -- and/or handler. Called only by the interal Timer task.
-
- procedure Cancel;
- -- Resets the timeout to Time_First and the handler to
- -- null. Called by procedure Cancel_Handler and by procedure Reset.
-
- function Current_Timeout return Time;
- -- Returns the currently set timeout. The value Time_First is returned
- -- if the Timing_Event is in the "cleared" state. Called by function
- -- Time_of_Event.
-
- function Current_Handler return Timing_Event_Handler;
- -- Returns the currently set handler. The value null is returned if the
- -- Timing_Event is in the "cleared" state. Called by function
- -- Curent_Handler.
-
- private
+ type Timing_Event is new Ada.Finalization.Limited_Controlled with record
Timeout : Time := Time_First;
-- The time at which the user's handler should be invoked when the
-- event is "set" (i.e., when Handler is not null).
@@ -109,16 +74,6 @@ private
-- An access value designating the protected procedure to be invoked
-- at the Timeout time in the future. When this value is null the event
-- is said to be "cleared" and no timeout is processed.
-
- Available : Boolean := True;
- -- A flag controlling when users can change the Timeout and Handler
- -- tuple. In particular the entry Set, called by procedure Set_Handler,
- -- is controlled by this flag.
-
- end Event_State;
-
- type Timing_Event is new Ada.Finalization.Limited_Controlled with record
- Control : Event_State;
end record;
overriding procedure Finalize (This : in out Timing_Event);
OpenPOWER on IntegriCloud