]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix mistake in recent patch
authorRonan Desplanques <desplanques@adacore.com>
Tue, 4 Nov 2025 16:23:13 +0000 (17:23 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 18 Nov 2025 15:05:09 +0000 (16:05 +0100)
A recent patch removed the wrong record definition in
s-taspri__mingw.ads, this patch fixes that mistake.

gcc/ada/ChangeLog:

* libgnarl/s-taspri__mingw.ads (Suspension_Object): Remove.
(Private_Data): Revert unintentional removal.

gcc/ada/libgnarl/s-taspri__mingw.ads

index b0fe8855b0d8970bed8df0c8a0678b3d7b70990b..b882a910b9cbe9e249f2a0b73c4ffee44e9579ad 100644 (file)
@@ -67,21 +67,23 @@ private
 
    type Condition_Variable is new System.Win32.HANDLE;
 
-   type Suspension_Object is record
-      State : Boolean;
-      pragma Atomic (State);
-      --  Boolean that indicates whether the object is open. This field is
-      --  marked Atomic to ensure that we can read its value without locking
-      --  the access to the Suspension_Object.
+   type Private_Data is limited record
+      Thread : aliased System.OS_Interface.Thread_Id;
+      pragma Atomic (Thread);
+      --  Thread field may be updated by two different threads of control.
+      --  (See, Enter_Task and Create_Task in s-taprop.adb).
+      --  They put the same value (thr_self value). We do not want to
+      --  use lock on those operations and the only thing we have to
+      --  make sure is that they are updated in atomic fashion.
 
-      Waiting : Boolean;
-      --  Flag showing if there is a task already suspended on this object
+      Thread_Id : aliased Win32.DWORD;
+      --  Used to provide a better tasking support in gdb
 
-      L : aliased System.OS_Locks.RTS_Lock;
-      --  Protection for ensuring mutual exclusion on the Suspension_Object
+      CV : aliased Condition_Variable;
+      --  Condition Variable used to implement Sleep/Wakeup
 
-      CV : aliased Win32.HANDLE;
-      --  Condition variable used to queue threads until condition is signaled
+      L : aliased System.OS_Locks.RTS_Lock;
+      --  Protection for all components is lock L
    end record;
 
 end System.Task_Primitives;