2009-04-24 Arnaud Charlet <charlet@adacore.com>
* s-tassta.adb (Create_Task): Fix violation of locking rule.
From-SVN: r146685
+2009-04-24 Arnaud Charlet <charlet@adacore.com>
+
+ * s-tassta.adb (Create_Task): Fix violation of locking rule.
+
2009-04-24 Emmanuel Briot <briot@adacore.com>
* prj.adb, prj.ads, prj-nmsc.adb, prj-env.adb (Language_Index): renamed
T.Common.Task_Image_Len := Len;
end if;
+ Unlock (Self_ID);
+ Unlock_RTS;
+
+ -- Note: we should not call 'new' while holding locks since new
+ -- may use locks (e.g. RTS_Lock under Windows) itself and cause a
+ -- deadlock.
+
if Build_Entry_Names then
T.Entry_Names :=
new Entry_Names_Array (1 .. Entry_Index (Num_Entries));
end if;
- Unlock (Self_ID);
- Unlock_RTS;
-
-- Create TSD as early as possible in the creation of a task, since it
-- may be used by the operation of Ada code within the task.