aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/s-taprop-mingw.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/s-taprop-mingw.adb')
-rw-r--r--gcc/ada/s-taprop-mingw.adb19
1 files changed, 7 insertions, 12 deletions
diff --git a/gcc/ada/s-taprop-mingw.adb b/gcc/ada/s-taprop-mingw.adb
index 89e7dc13811..cb51841a54d 100644
--- a/gcc/ada/s-taprop-mingw.adb
+++ b/gcc/ada/s-taprop-mingw.adb
@@ -807,18 +807,6 @@ package body System.Task_Primitives.Operations is
end if;
Self_ID.Common.LL.Thread_Id := GetCurrentThreadId;
-
- 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;
end Enter_Task;
--------------
@@ -1081,6 +1069,13 @@ package body System.Task_Primitives.Operations is
Initialize_Lock (Single_RTS_Lock'Access, RTS_Lock_Level);
Environment_Task.Common.LL.Thread := GetCurrentThread;
+
+ -- 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);
end Initialize;