Commit 96a8b705 by Jerome Lambourg Committed by Pierre-Marie de Rodat

[Ada] VxWorks: call s-tpopsp.Self only when needed

2019-08-12  Jerome Lambourg  <lambourg@adacore.com>

gcc/ada/

	* libgnarl/s-taprop__vxworks.adb (Abort_Handler): Only call
	s-tpopsp.Self when actually needed.

From-SVN: r274283
parent 43eb2bb6
2019-08-12 Jerome Lambourg <lambourg@adacore.com>
* libgnarl/s-taprop__vxworks.adb (Abort_Handler): Only call
s-tpopsp.Self when actually needed.
2019-08-12 Eric Botcazou <ebotcazou@adacore.com> 2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Discrete_Range_Check): Return if checks are * exp_ch4.adb (Discrete_Range_Check): Return if checks are
......
...@@ -192,7 +192,10 @@ package body System.Task_Primitives.Operations is ...@@ -192,7 +192,10 @@ package body System.Task_Primitives.Operations is
procedure Abort_Handler (signo : Signal) is procedure Abort_Handler (signo : Signal) is
pragma Unreferenced (signo); pragma Unreferenced (signo);
Self_ID : constant Task_Id := Self; -- Do not call Self at this point as we're in a signal handler
-- and it may not be available, in particular on targets where we
-- support ZCX and where we don't do anything here anyway.
Self_ID : Task_Id;
Old_Set : aliased sigset_t; Old_Set : aliased sigset_t;
Unblocked_Mask : aliased sigset_t; Unblocked_Mask : aliased sigset_t;
Result : int; Result : int;
...@@ -208,6 +211,8 @@ package body System.Task_Primitives.Operations is ...@@ -208,6 +211,8 @@ package body System.Task_Primitives.Operations is
return; return;
end if; end if;
Self_ID := Self;
if Self_ID.Deferral_Level = 0 if Self_ID.Deferral_Level = 0
and then Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level and then Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level
and then not Self_ID.Aborting and then not Self_ID.Aborting
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment