diff options
Diffstat (limited to 'gcc/ada/libgnarl')
-rw-r--r-- | gcc/ada/libgnarl/s-tassta.adb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/libgnarl/s-tassta.adb b/gcc/ada/libgnarl/s-tassta.adb index f18c76f..88850c2 100644 --- a/gcc/ada/libgnarl/s-tassta.adb +++ b/gcc/ada/libgnarl/s-tassta.adb @@ -910,12 +910,12 @@ package body System.Tasking.Stages is Self_Id : constant Task_Id := Self; begin + Initialization.Task_Lock (Self_Id); + if T.Common.State = Terminated then -- It is not safe to call Abort_Defer or Write_Lock at this stage - Initialization.Task_Lock (Self_Id); - Lock_RTS; Initialization.Finalize_Attributes (T); Initialization.Remove_From_All_Tasks_List (T); @@ -930,6 +930,7 @@ package body System.Tasking.Stages is -- upon termination. T.Free_On_Termination := True; + Initialization.Task_Unlock (Self_Id); end if; end Free_Task; |