diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 14:19:48 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 14:19:48 +0000 |
commit | ab759dab85d933ba536cd4d60e7cd5058d91d46e (patch) | |
tree | b15b484bca7e37e75b002ff11bffecb3a8bc4929 /gcc/ada/a-rttiev.adb | |
parent | 929bf274f3183dcfaf2e45c5a26cf55f849b4f32 (diff) | |
download | gcc-ab759dab85d933ba536cd4d60e7cd5058d91d46e.tar.gz |
2009-11-30 Robert Dewar <dewar@adacore.com>
* osint.adb, a-rttiev.adb: Minor reformatting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154808 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-rttiev.adb')
-rw-r--r-- | gcc/ada/a-rttiev.adb | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/gcc/ada/a-rttiev.adb b/gcc/ada/a-rttiev.adb index 55687ec8f6b..2fe78212c3d 100644 --- a/gcc/ada/a-rttiev.adb +++ b/gcc/ada/a-rttiev.adb @@ -75,9 +75,9 @@ package body Ada.Real_Time.Timing_Events is -- with mutually exclusive access via Event_Queue_Lock. procedure Remove_From_Queue (This : Any_Timing_Event); - -- Remove the specified event pointer from the queue of pending events - -- with mutually exclusive access via Event_Queue_Lock. - -- This procedure is used by the client-side routines (Set_Handler, etc.). + -- Remove the specified event pointer from the queue of pending events with + -- mutually exclusive access via Event_Queue_Lock. This procedure is used + -- by the client-side routines (Set_Handler, etc.). ----------- -- Timer -- @@ -94,6 +94,7 @@ package body Ada.Real_Time.Timing_Events is -- selected is arbitrary and could be changed to suit the application -- requirements. Obviously a shorter period would give better resolution -- at the cost of more overhead. + begin System.Tasking.Utilities.Make_Independent; @@ -171,6 +172,7 @@ package body Ada.Real_Time.Timing_Events is declare Handler : constant Timing_Event_Handler := Next_Event.Handler; + begin -- The first act is to clear the event, per D.15(13/2). Besides, -- we cannot clear the handler pointer *after* invoking the @@ -205,11 +207,17 @@ package body Ada.Real_Time.Timing_Events is package By_Timeout is new Events.Generic_Sorting (Sooner); -- Used to keep the events in ascending order by timeout value + ------------ + -- Sooner -- + ------------ + function Sooner (Left, Right : Any_Timing_Event) return Boolean is begin return Left.Timeout < Right.Timeout; end Sooner; + -- Start of processing for Insert_Into_Queue + begin SSL.Abort_Defer.all; @@ -236,12 +244,14 @@ package body Ada.Real_Time.Timing_Events is procedure Remove_From_Queue (This : Any_Timing_Event) is use Events; Location : Cursor; + begin SSL.Abort_Defer.all; Write_Lock (Event_Queue_Lock'Access); Location := All_Events.Find (This); + if Location /= No_Element then All_Events.Delete (Location); end if; @@ -332,13 +342,9 @@ package body Ada.Real_Time.Timing_Events is function Time_Of_Event (Event : Timing_Event) return Time is begin - -- RM D.15(18/2): Time_First must be returned if the event is not set + -- RM D.15(18/2): Time_First must be returned in the event is not set - if Event.Handler = null then - return Time_First; - else - return Event.Timeout; - end if; + return (if Event.Handler = null then Time_First else Event.Timeout); end Time_Of_Event; -------------- |