diff options
Diffstat (limited to 'gcc/ada/s-taprop-vxworks.adb')
-rw-r--r-- | gcc/ada/s-taprop-vxworks.adb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ada/s-taprop-vxworks.adb b/gcc/ada/s-taprop-vxworks.adb index 56a02dda238..186e8c28f40 100644 --- a/gcc/ada/s-taprop-vxworks.adb +++ b/gcc/ada/s-taprop-vxworks.adb @@ -51,11 +51,21 @@ with System.Interrupt_Management; with Interfaces.C; +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.Debug; use System.Tasking; use System.OS_Interface; @@ -1030,6 +1040,8 @@ package body System.Task_Primitives.Operations is procedure Set_False (S : in out Suspension_Object) is Result : STATUS; begin + SSL.Abort_Defer.all; + Result := semTake (S.L, WAIT_FOREVER); pragma Assert (Result = OK); @@ -1037,6 +1049,8 @@ package body System.Task_Primitives.Operations is Result := semGive (S.L); pragma Assert (Result = OK); + + SSL.Abort_Undefer.all; end Set_False; -------------- @@ -1046,6 +1060,8 @@ package body System.Task_Primitives.Operations is procedure Set_True (S : in out Suspension_Object) is Result : STATUS; begin + SSL.Abort_Defer.all; + Result := semTake (S.L, WAIT_FOREVER); pragma Assert (Result = OK); @@ -1066,6 +1082,8 @@ package body System.Task_Primitives.Operations is Result := semGive (S.L); pragma Assert (Result = OK); + + SSL.Abort_Undefer.all; end Set_True; ------------------------ @@ -1075,6 +1093,8 @@ package body System.Task_Primitives.Operations is procedure Suspend_Until_True (S : in out Suspension_Object) is Result : STATUS; begin + SSL.Abort_Defer.all; + Result := semTake (S.L, WAIT_FOREVER); if S.Waiting then @@ -1085,6 +1105,8 @@ package body System.Task_Primitives.Operations is Result := semGive (S.L); pragma Assert (Result = OK); + SSL.Abort_Undefer.all; + raise Program_Error; else -- Suspend the task if the state is False. Otherwise, the task @@ -1096,6 +1118,8 @@ package body System.Task_Primitives.Operations is Result := semGive (S.L); pragma Assert (Result = 0); + + SSL.Abort_Undefer.all; else S.Waiting := True; @@ -1104,6 +1128,8 @@ package body System.Task_Primitives.Operations is Result := semGive (S.L); pragma Assert (Result = OK); + SSL.Abort_Undefer.all; + Result := semTake (S.CV, WAIT_FOREVER); pragma Assert (Result = 0); end if; |