diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-11 09:31:53 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-11 09:31:53 +0000 |
commit | 8fa4b2980bd08af799e33bf24d06714e5a558d3d (patch) | |
tree | ddb6615dde6578ad9a5716a43b0cfd7e81e1672d /gcc/ada/s-osprim-mingw.adb | |
parent | 6c1f6b490fa53f3bcfb99e81d453378539ef5b53 (diff) | |
download | gcc-8fa4b2980bd08af799e33bf24d06714e5a558d3d.tar.gz |
2013-04-11 Robert Dewar <dewar@adacore.com>
* s-osprim-mingw.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb.
makeutl.adb, sem_ch8.adb: Minor reformatting.
2013-04-11 Vincent Celier <celier@adacore.com>
* gnat_ugn.texi: Minor fixes for VMS.
* ug_words: Minor addition: -gnato? => /OVERFLOW_CHECKS=?.
2013-04-11 Robert Dewar <dewar@adacore.com>
* usage.adb (Usage): Minor edit to -gnatW message
2013-04-11 Robert Dewar <dewar@adacore.com>
* exp_aggr.adb (Expand_N_Aggregate): Add circuit for handling
others for string literal case. Also add big ??? comment about
this new code, which should be redundant, but is not.
* sem_eval.adb (Eval_Concatenation): Handle non-static case
properly (Eval_String_Literal): Handle non-static literal properly
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197744 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-osprim-mingw.adb')
-rw-r--r-- | gcc/ada/s-osprim-mingw.adb | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/gcc/ada/s-osprim-mingw.adb b/gcc/ada/s-osprim-mingw.adb index 874b1cb186a..a2c466406c4 100644 --- a/gcc/ada/s-osprim-mingw.adb +++ b/gcc/ada/s-osprim-mingw.adb @@ -68,17 +68,17 @@ package body System.OS_Primitives is type Clock_Data_Access is access all Clock_Data; - -- Two base clock buffers. This is used to be able to update a buffer - -- while the other buffer is read. The point is that we do not want to - -- use a lock inside the Clock routine for performance reasons. We still - -- use a lock in the Get_Base_Time which is called very rarely. Current - -- is a pointer, the pragma Atomic is there to ensure that the value can - -- be set or read atomically. That's it, when Get_Base_Time has updated - -- a buffer the switch to the new value is done by changing Current - -- pointer. + -- Two base clock buffers. This is used to be able to update a buffer while + -- the other buffer is read. The point is that we do not want to use a lock + -- inside the Clock routine for performance reasons. We still use a lock + -- in the Get_Base_Time which is called very rarely. Current is a pointer, + -- the pragma Atomic is there to ensure that the value can be set or read + -- atomically. That's it, when Get_Base_Time has updated a buffer the + -- switch to the new value is done by changing Current pointer. First, Second : aliased Clock_Data; - Current : Clock_Data_Access := First'Access; + + Current : Clock_Data_Access := First'Access; pragma Atomic (Current); -- The following signature is to detect change on the base clock data @@ -177,9 +177,11 @@ package body System.OS_Primitives is epoch_1970 : constant := 16#19D_B1DE_D53E_8000#; -- win32 UTC epoch system_time_ns : constant := 100; -- 100 ns per tick Sec_Unit : constant := 10#1#E9; - Max_Elapsed : constant LARGE_INTEGER := + + Max_Elapsed : constant LARGE_INTEGER := LARGE_INTEGER (Tick_Frequency / 100_000); -- Look for a precision of 0.01 ms + Sig : constant Signature_Type := Signature; Loc_Ticks, Ctrl_Ticks : aliased LARGE_INTEGER; @@ -269,13 +271,14 @@ package body System.OS_Primitives is end if; end loop; - New_Data.Base_Clock := Duration - (Long_Long_Float ((New_Data.Base_Time - epoch_1970) * system_time_ns) / - Long_Long_Float (Sec_Unit)); + New_Data.Base_Clock := + Duration + (Long_Long_Float + ((New_Data.Base_Time - epoch_1970) * system_time_ns) / + Long_Long_Float (Sec_Unit)); -- At this point all the base values have been set into the new data - -- record. We just change the pointer (atomic operation) to this new - -- values. + -- record. Change the pointer (atomic operation) to these new values. Current := New_Data; Data := New_Data.all; |