aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/s-taprop-tru64.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/s-taprop-tru64.adb')
-rw-r--r--gcc/ada/s-taprop-tru64.adb30
1 files changed, 17 insertions, 13 deletions
diff --git a/gcc/ada/s-taprop-tru64.adb b/gcc/ada/s-taprop-tru64.adb
index ce4195b8029..20b0bbc04ad 100644
--- a/gcc/ada/s-taprop-tru64.adb
+++ b/gcc/ada/s-taprop-tru64.adb
@@ -707,19 +707,8 @@ package body System.Task_Primitives.Operations is
begin
Hide_Unhide_Yellow_Zone (Hide => True);
Self_ID.Common.LL.Thread := pthread_self;
- Specific.Set (Self_ID);
-
- Lock_RTS;
-
- for J in Known_Tasks'Range loop
- if Known_Tasks (J) = null then
- Known_Tasks (J) := Self_ID;
- Self_ID.Known_Tasks_Index := J;
- exit;
- end if;
- end loop;
- Unlock_RTS;
+ Specific.Set (Self_ID);
end Enter_Task;
--------------
@@ -1181,7 +1170,16 @@ package body System.Task_Primitives.Operations is
S.State := False;
else
S.Waiting := True;
- Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+
+ loop
+ -- loop in case pthread_cond_wait returns earlier than
+ -- expected (e.g. in case of EINTR caused by a signal).
+
+ Result := pthread_cond_wait (S.CV'Access, S.L'Access);
+ pragma Assert (Result = 0 or else Result = EINTR);
+
+ exit when not S.Waiting;
+ end loop;
end if;
Result := pthread_mutex_unlock (S.L'Access);
@@ -1343,6 +1341,12 @@ package body System.Task_Primitives.Operations is
Specific.Initialize (Environment_Task);
+ -- Make environment task known here because it doesn't go through
+ -- Activate_Tasks, which does it for all other tasks.
+
+ Known_Tasks (Known_Tasks'First) := Environment_Task;
+ Environment_Task.Known_Tasks_Index := Known_Tasks'First;
+
Enter_Task (Environment_Task);
-- Install the abort-signal handler