2016-10-26 François Dumont <fdumont@gcc.gnu.org>
[official-gcc.git] / gcc / ada / a-extiti.ads
blob411371dec0eebb1baacf12c08e1a9c5913296ccb
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- A D A . E X E C U T I O N _ T I M E . T I M E R S --
6 -- --
7 -- S p e c --
8 -- --
9 -- This specification is derived from the Ada Reference Manual for use with --
10 -- GNAT. In accordance with the copyright of that document, you can freely --
11 -- copy and modify this specification, provided that if you redistribute a --
12 -- modified version, any changes that you have made are clearly indicated. --
13 -- --
14 ------------------------------------------------------------------------------
16 -- This unit is not implemented in typical GNAT implementations that lie on
17 -- top of operating systems, because it is infeasible to implement in such
18 -- environments.
20 -- If a target environment provides appropriate support for this package,
21 -- then the Unimplemented_Unit pragma should be removed from this spec and
22 -- an appropriate body provided.
24 with System;
26 package Ada.Execution_Time.Timers is
27 pragma Preelaborate;
29 pragma Unimplemented_Unit;
31 type Timer (T : not null access constant Ada.Task_Identification.Task_Id) is
32 tagged limited private;
34 type Timer_Handler is access protected procedure (TM : in out Timer);
36 Min_Handler_Ceiling : constant System.Any_Priority := System.Priority'Last;
38 procedure Set_Handler
39 (TM : in out Timer;
40 In_Time : Ada.Real_Time.Time_Span;
41 Handler : Timer_Handler);
43 procedure Set_Handler
44 (TM : in out Timer;
45 At_Time : CPU_Time;
46 Handler : Timer_Handler);
48 function Current_Handler (TM : Timer) return Timer_Handler;
50 procedure Cancel_Handler
51 (TM : in out Timer;
52 Cancelled : out Boolean);
54 function Time_Remaining (TM : Timer) return Ada.Real_Time.Time_Span;
56 Timer_Resource_Error : exception;
58 private
59 type Timer (T : access Ada.Task_Identification.Task_Id) is
60 tagged limited null record;
61 end Ada.Execution_Time.Timers;