summaryrefslogtreecommitdiff
path: root/gcc/ada/s-taprop-irix.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/s-taprop-irix.adb')
-rw-r--r--gcc/ada/s-taprop-irix.adb30
1 files changed, 27 insertions, 3 deletions
diff --git a/gcc/ada/s-taprop-irix.adb b/gcc/ada/s-taprop-irix.adb
index 8b048e47257..efae88249dd 100644
--- a/gcc/ada/s-taprop-irix.adb
+++ b/gcc/ada/s-taprop-irix.adb
@@ -60,11 +60,21 @@ with System.OS_Primitives;
with System.IO;
-- used for Put_Line
+with System.Soft_Links;
+-- used for Abort_Defer/Undefer
+
+-- We use System.Soft_Links instead of System.Tasking.Initialization
+-- because the later is a higher level package that we shouldn't depend on.
+-- For example when using the restricted run time, it is replaced by
+-- System.Tasking.Restricted.Stages.
+
with Unchecked_Conversion;
with Unchecked_Deallocation;
package body System.Task_Primitives.Operations is
+ package SSL renames System.Soft_Links;
+
use System.Tasking;
use System.Tasking.Debug;
use Interfaces.C;
@@ -1019,6 +1029,8 @@ package body System.Task_Primitives.Operations is
procedure Set_False (S : in out Suspension_Object) is
Result : Interfaces.C.int;
begin
+ SSL.Abort_Defer.all;
+
Result := pthread_mutex_lock (S.L'Access);
pragma Assert (Result = 0);
@@ -1026,6 +1038,8 @@ package body System.Task_Primitives.Operations is
Result := pthread_mutex_unlock (S.L'Access);
pragma Assert (Result = 0);
+
+ SSL.Abort_Undefer.all;
end Set_False;
--------------
@@ -1035,6 +1049,8 @@ package body System.Task_Primitives.Operations is
procedure Set_True (S : in out Suspension_Object) is
Result : Interfaces.C.int;
begin
+ SSL.Abort_Defer.all;
+
Result := pthread_mutex_lock (S.L'Access);
pragma Assert (Result = 0);
@@ -1055,6 +1071,8 @@ package body System.Task_Primitives.Operations is
Result := pthread_mutex_unlock (S.L'Access);
pragma Assert (Result = 0);
+
+ SSL.Abort_Undefer.all;
end Set_True;
------------------------
@@ -1064,6 +1082,8 @@ package body System.Task_Primitives.Operations is
procedure Suspend_Until_True (S : in out Suspension_Object) is
Result : Interfaces.C.int;
begin
+ SSL.Abort_Defer.all;
+
Result := pthread_mutex_lock (S.L'Access);
pragma Assert (Result = 0);
@@ -1075,6 +1095,8 @@ package body System.Task_Primitives.Operations is
Result := pthread_mutex_unlock (S.L'Access);
pragma Assert (Result = 0);
+ SSL.Abort_Undefer.all;
+
raise Program_Error;
else
-- Suspend the task if the state is False. Otherwise, the task
@@ -1087,10 +1109,12 @@ package body System.Task_Primitives.Operations is
S.Waiting := True;
Result := pthread_cond_wait (S.CV'Access, S.L'Access);
end if;
- end if;
- Result := pthread_mutex_unlock (S.L'Access);
- pragma Assert (Result = 0);
+ Result := pthread_mutex_unlock (S.L'Access);
+ pragma Assert (Result = 0);
+
+ SSL.Abort_Undefer.all;
+ end if;
end Suspend_Until_True;
----------------