[Ada] Ensure System.Tasking.Debug.Known_Tasks component access is atomic
authorPatrick Bernardi <bernardi@adacore.com>
Wed, 14 Apr 2021 03:50:57 +0000 (13:50 +1000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 29 Jun 2021 14:23:48 +0000 (14:23 +0000)
gcc/ada/

* libgnarl/s-tasdeb.ads (Known_Tasks): Add Atomic_Components
aspect.

gcc/ada/libgnarl/s-tasdeb.ads

index 3e8a8d8..eebb2a9 100644 (file)
@@ -65,9 +65,11 @@ package System.Tasking.Debug is
    -- General GDB support --
    -------------------------
 
-   Known_Tasks : array (0 .. 999) of Task_Id := (others => null);
+   Known_Tasks : array (0 .. 999) of Task_Id := (others => null)
+     with Atomic_Components;
    --  Global array of tasks read by gdb, and updated by Create_Task and
-   --  Finalize_TCB
+   --  Finalize_TCB. Ensure access to its components is atomic to allow
+   --  lock-free concurrent access.
 
    Debug_Event_Activating           : constant := 1;
    Debug_Event_Run                  : constant := 2;