浏览代码

exit the DLL-loading thread from A2 at the return of Kernel32.EntryPoint (DllMain)

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8587 8c9fc860-2736-0410-a75d-ab315db34111
eth.morozova 6 年之前
父节点
当前提交
08792cdcb9
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      source/Modules.Mod

+ 4 - 1
source/Modules.Mod

@@ -879,13 +879,16 @@ END Main;
 
 
 (* procedure that will be called last in a linked kernel *)
 (* procedure that will be called last in a linked kernel *)
 PROCEDURE {FINAL, NOPAF} Main-;
 PROCEDURE {FINAL, NOPAF} Main-;
+PROCEDURE ExitA2 EXTERN "Objects.ExitA2"();
 BEGIN
 BEGIN
 	(*Machine.Init;*)
 	(*Machine.Init;*)
 	IF TraceBoot THEN
 	IF TraceBoot THEN
 		Trace.String("publish registered modules"); Trace.Ln;
 		Trace.String("publish registered modules"); Trace.Ln;
 	END;
 	END;
 	PublishRegisteredModules;
 	PublishRegisteredModules;
-#IF ~SHAREDLIB THEN
+#IF SHAREDLIB THEN
+	ExitA2; (*! at this point the DLL loading thread exits the A2 (returns from Kernel32.EntryPoint/DllMain) *)
+#ELSE
 	(* a standard A2 kernel does not reach this point, but for standalone executables this is required *)
 	(* a standard A2 kernel does not reach this point, but for standalone executables this is required *)
 	Machine.Shutdown(FALSE);
 	Machine.Shutdown(FALSE);
 #END;
 #END;