summaryrefslogtreecommitdiff
path: root/gcc/ada/s-taprop-solaris.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-18 13:40:54 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-18 13:40:54 +0000
commitd2cf6f2ed6c0439478a7deb0372395171d18e26f (patch)
tree60698fbf303f15de24e86c6bb64c0aef1c577c52 /gcc/ada/s-taprop-solaris.adb
parent14a02588972bf9f27cff981fa464978c07f039c9 (diff)
downloadgcc-d2cf6f2ed6c0439478a7deb0372395171d18e26f.tar.gz
2009-09-18 Arnaud Charlet <charlet@adacore.com>
* s-taprop-tru64.adb, s-taprop-linux.adb, s-taprop-solaris.adb, s-taprop-irix.adb, s-taprop-posix.adb (Abort_Task): Do nothing if no signal handler is installed. * s-tassta.adb (Finalize_Global_Tasks): Do not wait for independent tasks if Abort_Task_Interrupt cannot be used. 2009-09-18 Vincent Celier <celier@adacore.com> * prj-tree.ads: Minor comment update git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151841 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-taprop-solaris.adb')
-rw-r--r--gcc/ada/s-taprop-solaris.adb28
1 files changed, 17 insertions, 11 deletions
diff --git a/gcc/ada/s-taprop-solaris.adb b/gcc/ada/s-taprop-solaris.adb
index cf2a09e2a24..1e47b9486ed 100644
--- a/gcc/ada/s-taprop-solaris.adb
+++ b/gcc/ada/s-taprop-solaris.adb
@@ -97,6 +97,9 @@ package body System.Task_Primitives.Operations is
-- using in error checking.
-- The following are internal configuration constants needed.
+ Abort_Handler_Installed : Boolean := False;
+ -- True if a handler for the abort signal is installed
+
----------------------
-- Priority Support --
----------------------
@@ -256,8 +259,10 @@ package body System.Task_Primitives.Operations is
pragma Warnings (Off, Result);
begin
- -- It is not safe to raise an exception when using ZCX and the GCC
- -- exception handling mechanism.
+ -- It's not safe to raise an exception when using GCC ZCX mechanism.
+ -- Note that we still need to install a signal handler, since in some
+ -- cases (e.g. shutdown of the Server_Task in System.Interrupts) we
+ -- need to send the Abort signal to a task.
if ZCX_By_Default and then GCC_ZCX_Support then
return;
@@ -487,7 +492,7 @@ package body System.Task_Primitives.Operations is
Enter_Task (Environment_Task);
- -- Install the abort-signal handler
+ Configure_Processors;
if State
(System.Interrupt_Management.Abort_Task_Interrupt) /= Default
@@ -513,9 +518,8 @@ package body System.Task_Primitives.Operations is
act'Unchecked_Access,
old_act'Unchecked_Access);
pragma Assert (Result = 0);
+ Abort_Handler_Installed := True;
end if;
-
- Configure_Processors;
end Initialize;
---------------------
@@ -1095,12 +1099,14 @@ package body System.Task_Primitives.Operations is
procedure Abort_Task (T : Task_Id) is
Result : Interfaces.C.int;
begin
- pragma Assert (T /= Self);
- Result :=
- thr_kill
- (T.Common.LL.Thread,
- Signal (System.Interrupt_Management.Abort_Task_Interrupt));
- pragma Assert (Result = 0);
+ if Abort_Handler_Installed then
+ pragma Assert (T /= Self);
+ Result :=
+ thr_kill
+ (T.Common.LL.Thread,
+ Signal (System.Interrupt_Management.Abort_Task_Interrupt));
+ pragma Assert (Result = 0);
+ end if;
end Abort_Task;
-----------