-- --
-- B o d y --
-- --
--- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
-- --
-- GNAT 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- --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Task_Primitives.Operations;
-- used for Self
-with System.Task_Info;
-use type System.Task_Info.Task_Image_Type;
-
with Unchecked_Conversion;
package body Ada.Task_Identification is
-- Local Subprograms --
-----------------------
- function Convert_Ids (T : Task_Id) return System.Tasking.Task_ID;
- function Convert_Ids (T : System.Tasking.Task_ID) return Task_Id;
+ function Convert_Ids (T : Task_Id) return System.Tasking.Task_Id;
+ function Convert_Ids (T : System.Tasking.Task_Id) return Task_Id;
pragma Inline (Convert_Ids);
-- Conversion functions between different forms of Task_Id
-- Convert_Ids --
-----------------
- function Convert_Ids (T : Task_Id) return System.Tasking.Task_ID is
+ function Convert_Ids (T : Task_Id) return System.Tasking.Task_Id is
begin
- return System.Tasking.Task_ID (T);
+ return System.Tasking.Task_Id (T);
end Convert_Ids;
- function Convert_Ids (T : System.Tasking.Task_ID) return Task_Id is
+ function Convert_Ids (T : System.Tasking.Task_Id) return Task_Id is
begin
return Task_Id (T);
end Convert_Ids;
-----------
function Image (T : Task_Id) return String is
- use System.Task_Info;
function To_Address is new
Unchecked_Conversion (Task_Id, System.Address);
if T = Null_Task_Id then
return "";
- elsif T.Common.Task_Image = null then
+ elsif T.Common.Task_Image_Len = 0 then
return System.Address_Image (To_Address (T));
else
- return T.Common.Task_Image.all
+ return T.Common.Task_Image (1 .. T.Common.Task_Image_Len)
& "_" & System.Address_Image (To_Address (T));
end if;
end Image;