-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2001, Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2004, 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- --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
--- GNARL was developed by the GNARL team at Florida State University. It is --
--- now maintained by Ada Core Technologies, Inc. (http://www.gnat.com). --
+-- GNARL was developed by the GNARL team at Florida State University. --
+-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
with System.Task_Info;
-- used for Task_Info_Type
--- Task_Image_Type
with System.Task_Primitives.Operations;
-- used for Enter_Task
-- all nested locks must be released before other tasks competing for the
-- tasking lock are released.
+ -- See s-tasini.adb for more information on the following functions.
+
function Get_Jmpbuf_Address return Address;
procedure Set_Jmpbuf_Address (Addr : Address);
procedure Timed_Delay_T (Time : Duration; Mode : Integer);
- ------------------------
- -- Local Subprograms --
- ------------------------
+ -----------------------
+ -- Local Subprograms --
+ -----------------------
- procedure Task_Wrapper (Self_ID : Task_ID);
+ procedure Task_Wrapper (Self_ID : Task_Id);
-- This is the procedure that is called by the GNULL from the
-- new context when a task is created. It waits for activation
-- and then calls the task body procedure. When the task body
-- procedure completes, it terminates the task.
- procedure Terminate_Task (Self_ID : Task_ID);
+ procedure Terminate_Task (Self_ID : Task_Id);
-- Terminate the calling task.
-- This should only be called by the Task_Wrapper procedure.
-- of the current thread, since it should be at a fixed offset from the
-- stack base.
- procedure Task_Wrapper (Self_ID : Task_ID) is
- ID : Task_ID := Self_ID;
+ procedure Task_Wrapper (Self_ID : Task_Id) is
+ ID : Task_Id := Self_ID;
pragma Volatile (ID);
+ pragma Warnings (Off, ID);
+ -- Turn off warnings (stand alone volatile constant has to be
+ -- imported, so we cannot just make ID constant).
+
-- Do not delete this variable.
-- In some targets, we need this variable to implement a fast Self.
procedure Activate_Restricted_Tasks
(Chain_Access : Activation_Chain_Access)
is
- Self_ID : constant Task_ID := STPO.Self;
- C : Task_ID;
+ Self_ID : constant Task_Id := STPO.Self;
+ C : Task_Id;
Activate_Prio : System.Any_Priority;
Success : Boolean;
-- activator.
procedure Complete_Restricted_Activation is
- Self_ID : constant Task_ID := STPO.Self;
- Activator : constant Task_ID := Self_ID.Common.Activator;
+ Self_ID : constant Task_Id := STPO.Self;
+ Activator : constant Task_Id := Self_ID.Common.Activator;
begin
if Single_Lock then
Discriminants : System.Address;
Elaborated : Access_Boolean;
Chain : in out Activation_Chain;
- Task_Image : System.Task_Info.Task_Image_Type;
- Created_Task : out Task_ID)
+ Task_Image : String;
+ Created_Task : out Task_Id)
is
- T : Task_ID;
- Self_ID : constant Task_ID := STPO.Self;
+ T : Task_Id;
+ Self_ID : constant Task_Id := STPO.Self;
Base_Priority : System.Any_Priority;
Success : Boolean;
end if;
T.Entry_Calls (1).Self := T;
- T.Common.Task_Image := Task_Image;
+
+ T.Common.Task_Image_Len :=
+ Integer'Min (T.Common.Task_Image'Length, Task_Image'Length);
+ T.Common.Task_Image (1 .. T.Common.Task_Image_Len) := Task_Image;
+
Unlock (Self_ID);
if Single_Lock then
-- forever, since none of the dependent tasks are expected to terminate
procedure Finalize_Global_Tasks is
- Self_ID : constant Task_ID := STPO.Self;
+ Self_ID : constant Task_Id := STPO.Self;
+
begin
pragma Assert (Self_ID = STPO.Environment_Task);
-- Restricted_Terminated --
---------------------------
- function Restricted_Terminated (T : Task_ID) return Boolean is
+ function Restricted_Terminated (T : Task_Id) return Boolean is
begin
return T.Common.State = Terminated;
end Restricted_Terminated;
-- Terminate_Task --
--------------------
- procedure Terminate_Task (Self_ID : Task_ID) is
+ procedure Terminate_Task (Self_ID : Task_Id) is
begin
Self_ID.Common.State := Terminated;
end Terminate_Task;