]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Tweak handling of thread ID on POSIX
authorRonan Desplanques <desplanques@adacore.com>
Mon, 25 Mar 2024 13:36:56 +0000 (14:36 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 20 May 2024 07:47:04 +0000 (09:47 +0200)
commit0d119fb79e884c9ee5e1ccbbb98311780f92413d
tree8de30784906bf5ace55771b75a28dc356c998d7b
parent103e7f3a94b85c18a134a0fd8893b85e548882cb
ada: Tweak handling of thread ID on POSIX

This patch changes the task initialization subprograms on POSIX
platforms so that the thread ID of an ATCB is only set once.
This has the advantage of getting rid of the Atomic aspect on
the corresponding record component, and silences a Helgrind
warning about a data race.

gcc/ada/

* libgnarl/s-taprop__linux.adb (Enter_Task): Move setting
of thread ID out of Enter_Task.
(Initialize): Set thread ID for the environment task.
(Create_Task): Remove now unnecessary Unrestricted_Access
attribute and add justification for a memory write.
* libgnarl/s-taprop__posix.adb: Likewise.
* libgnarl/s-taprop__qnx.adb: Likewise.
* libgnarl/s-taprop__rtems.adb: Likewise.
* libgnarl/s-taprop__solaris.adb: Likewise.
* libgnarl/s-taspri__posix.ads: Remove pragma Atomic for
Private_Data.Thread, and update documentation comment.
* libgnarl/s-taspri__lynxos.ads: Likewise.
* libgnarl/s-taspri__posix-noaltstack.ads: Likewise.
* libgnarl/s-taspri__solaris.ads: Likewise.
* libgnarl/s-tporft.adb (Register_Foreign_Thread): Adapt to
Enter_Task not setting the thread ID anymore.
* libgnarl/s-tassta.adb (Task_Wrapper): Update comment.
gcc/ada/libgnarl/s-taprop__linux.adb
gcc/ada/libgnarl/s-taprop__posix.adb
gcc/ada/libgnarl/s-taprop__qnx.adb
gcc/ada/libgnarl/s-taprop__rtems.adb
gcc/ada/libgnarl/s-taprop__solaris.adb
gcc/ada/libgnarl/s-taspri__lynxos.ads
gcc/ada/libgnarl/s-taspri__posix-noaltstack.ads
gcc/ada/libgnarl/s-taspri__posix.ads
gcc/ada/libgnarl/s-taspri__solaris.ads
gcc/ada/libgnarl/s-tassta.adb
gcc/ada/libgnarl/s-tporft.adb