aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2019-07-11 08:01:25 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-07-11 08:01:25 +0000
commita1a8b1726cf8de2ed244353a9c8cd2fab12e4c71 (patch)
tree60db77ac194cfccd8a771989478e98cdd692f3dc
parent490ed9ba846d15baba24646b7ecf3ed6b7c19fcb (diff)
downloadgcc-a1a8b1726cf8de2ed244353a9c8cd2fab12e4c71.zip
gcc-a1a8b1726cf8de2ed244353a9c8cd2fab12e4c71.tar.gz
gcc-a1a8b1726cf8de2ed244353a9c8cd2fab12e4c71.tar.bz2
[Ada] GNAT.Threads: Add a Get_Thread overload taking a Task_Id
2019-07-11 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnarl/g-thread.ads, libgnarl/g-thread.adb (Get_Thread): Update comments. Add new version taking a Task_Id. From-SVN: r273380
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/libgnarl/g-thread.adb9
-rw-r--r--gcc/ada/libgnarl/g-thread.ads4
3 files changed, 15 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index fa580d2..703280c 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2019-07-11 Arnaud Charlet <charlet@adacore.com>
+
+ * libgnarl/g-thread.ads, libgnarl/g-thread.adb (Get_Thread):
+ Update comments. Add new version taking a Task_Id.
+
2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
* bindo.adb: Update the section of switches and debugging
diff --git a/gcc/ada/libgnarl/g-thread.adb b/gcc/ada/libgnarl/g-thread.adb
index f4ce92e..ae61937 100644
--- a/gcc/ada/libgnarl/g-thread.adb
+++ b/gcc/ada/libgnarl/g-thread.adb
@@ -168,9 +168,14 @@ package body GNAT.Threads is
----------------
procedure Get_Thread (Id : Address; Thread : Address) is
- Thr : constant Thread_Id_Ptr := To_Thread (Thread);
begin
- Thr.all := Task_Primitives.Operations.Get_Thread_Id (To_Id (Id));
+ To_Thread (Thread).all :=
+ Task_Primitives.Operations.Get_Thread_Id (To_Id (Id));
+ end Get_Thread;
+
+ procedure Get_Thread (Id : Task_Id; Thread : Address) is
+ begin
+ Get_Thread (To_Addr (Id), Thread);
end Get_Thread;
----------------------
diff --git a/gcc/ada/libgnarl/g-thread.ads b/gcc/ada/libgnarl/g-thread.ads
index ad4a075..8792e9a 100644
--- a/gcc/ada/libgnarl/g-thread.ads
+++ b/gcc/ada/libgnarl/g-thread.ads
@@ -129,9 +129,11 @@ package GNAT.Threads is
procedure Get_Thread (Id : System.Address; Thread : System.Address);
pragma Export (C, Get_Thread, "__gnat_get_thread");
+ procedure Get_Thread
+ (Id : Ada.Task_Identification.Task_Id; Thread : System.Address);
-- This procedure is used to retrieve the thread id of a given task.
-- The value Id is the value that was passed to the thread code procedure
- -- at activation time.
+ -- at activation time or a Task_Id.
-- Thread is a pointer to a thread id that will be updated by this
-- procedure.
--