-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNARL; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
+-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
+-- As a special exception under Section 7 of GPL version 3, you are granted --
+-- additional permissions described in the GCC Runtime Library Exception, --
+-- version 3.1, as published by the Free Software Foundation. --
+-- --
+-- You should have received a copy of the GNU General Public License and --
+-- a copy of the GCC Runtime Library Exception along with this program; --
+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
+-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- Turn off polling, we do not want ATC polling to take place during
-- tasking operations. It causes infinite loops and other problems.
-with Ada.Exceptions;
--- Used for Raise_Exception
+with Ada.Unchecked_Conversion;
+with Ada.Task_Identification;
with System.Task_Primitives.Operations;
--- Used for Write_Lock,
--- Unlock,
--- Self,
--- Monotonic_Clock,
--- Self,
--- Timed_Sleep,
--- Wakeup,
--- Yield
-
with System.Tasking.Utilities;
--- Used for Make_Independent
-
with System.Tasking.Initialization;
--- Used for Defer_Abort
--- Undefer_Abort
-
with System.Tasking.Debug;
--- Used for Trace
-
with System.OS_Primitives;
--- used for Max_Sensible_Delay
-
-with Ada.Task_Identification;
--- used for Task_Id type
-
with System.Interrupt_Management.Operations;
--- used for Setup_Interrupt_Mask
-
with System.Parameters;
--- used for Single_Lock
--- Runtime_Traces
-
with System.Traces.Tasking;
--- used for Send_Trace_Info
-
-with Unchecked_Conversion;
package body System.Tasking.Async_Delays is
use System.Traces;
use System.Traces.Tasking;
- function To_System is new Unchecked_Conversion
+ function To_System is new Ada.Unchecked_Conversion
(Ada.Task_Identification.Task_Id, Task_Id);
Timer_Server_ID : ST.Task_Id;
"async delay from within abort-deferred region");
if Self_Id.ATC_Nesting_Level = ATC_Level'Last then
- Ada.Exceptions.Raise_Exception (Storage_Error'Identity,
- "not enough ATC nesting levels");
+ raise Storage_Error with "not enough ATC nesting levels";
end if;
Self_Id.ATC_Nesting_Level := Self_Id.ATC_Nesting_Level + 1;
task body Timer_Server is
function Get_Next_Wakeup_Time return Duration;
-- Used to initialize Next_Wakeup_Time, but also to ensure that
- -- Make_Independent is called during the elaboration of this task
+ -- Make_Independent is called during the elaboration of this task.
--------------------------
-- Get_Next_Wakeup_Time --
return Duration'Last;
end Get_Next_Wakeup_Time;
+ -- Local Declarations
+
Next_Wakeup_Time : Duration := Get_Next_Wakeup_Time;
Timedout : Boolean;
Yielded : Boolean;
Dequeued : Delay_Block_Access;
Dequeued_Task : Task_Id;
+ pragma Unreferenced (Timedout, Yielded);
+
begin
Timer_Server_ID := STPO.Self;
Timer_Attention := False;
Now := STPO.Monotonic_Clock;
-
while Timer_Queue.Succ.Resume_Time <= Now loop
-- Dequeue the waiting task from the front of the queue
------------------------------
begin
- Timer_Queue.Succ := Timer_Queue'Unchecked_Access;
- Timer_Queue.Pred := Timer_Queue'Unchecked_Access;
+ Timer_Queue.Succ := Timer_Queue'Access;
+ Timer_Queue.Pred := Timer_Queue'Access;
Timer_Queue.Resume_Time := Duration'Last;
Timer_Server_ID := To_System (Timer_Server'Identity);
end System.Tasking.Async_Delays;