mirror of git://gcc.gnu.org/git/gcc.git
parent
a54e3bf051
commit
0d305ef004
|
|
@ -1076,9 +1076,11 @@ package body System.Task_Primitives.Operations is
|
||||||
|
|
||||||
procedure Abort_Task (T : Task_Id) is
|
procedure Abort_Task (T : Task_Id) is
|
||||||
Result : Interfaces.C.int;
|
Result : Interfaces.C.int;
|
||||||
|
|
||||||
ESRCH : constant := 3; -- No such process
|
ESRCH : constant := 3; -- No such process
|
||||||
-- It can happen that T has already vanished, in which case pthread_kill
|
-- It can happen that T has already vanished, in which case pthread_kill
|
||||||
-- returns ESRCH, so we don't consider that to be an error.
|
-- returns ESRCH, so we don't consider that to be an error.
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if Abort_Handler_Installed then
|
if Abort_Handler_Installed then
|
||||||
Result :=
|
Result :=
|
||||||
|
|
|
||||||
|
|
@ -870,15 +870,14 @@ package body System.Tasking.Stages is
|
||||||
Write_Lock (Self_ID);
|
Write_Lock (Self_ID);
|
||||||
|
|
||||||
-- If the Abort_Task signal is set to system, it means that we may
|
-- If the Abort_Task signal is set to system, it means that we may
|
||||||
-- not have been able to abort all independent tasks (in particular
|
-- not have been able to abort all independent tasks (in particular,
|
||||||
-- Server_Task may be blocked, waiting for a signal), in which case, do
|
-- Server_Task may be blocked, waiting for a signal), in which case, do
|
||||||
-- not wait for Independent_Task_Count to go down to 0. We arbitrarily
|
-- not wait for Independent_Task_Count to go down to 0. We arbitrarily
|
||||||
-- limit the number of loop iterations; if an independent task does not
|
-- limit the number of loop iterations; if an independent task does not
|
||||||
-- terminate, we do not want to hang here. In that case, the thread will
|
-- terminate, we do not want to hang here. In that case, the thread will
|
||||||
-- be terminated when the process exits.
|
-- be terminated when the process exits.
|
||||||
|
|
||||||
if State (System.Interrupt_Management.Abort_Task_Interrupt) /=
|
if State (System.Interrupt_Management.Abort_Task_Interrupt) /= Default
|
||||||
Default
|
|
||||||
then
|
then
|
||||||
for J in 1 .. 10 loop
|
for J in 1 .. 10 loop
|
||||||
exit when Utilities.Independent_Task_Count = 0;
|
exit when Utilities.Independent_Task_Count = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue