2
0
Эх сурвалжийг харах

Moved shutdown out of executor thread

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8289 8c9fc860-2736-0410-a75d-ab315db34111
negelef 7 жил өмнө
parent
commit
78fd1f309e

+ 6 - 8
source/StdIOShell.Mod

@@ -47,22 +47,20 @@ TYPE
 			AWAIT(done);
 			AWAIT(done);
 		END Wait;
 		END Wait;
 		
 		
-	BEGIN{ACTIVE}
+	BEGIN {ACTIVE, EXCLUSIVE}
 		IF Execute(StdIO.env) THEN code := Modules.Reboot END;
 		IF Execute(StdIO.env) THEN code := Modules.Reboot END;
 	FINALLY
 	FINALLY
-		IF Verbose THEN
-			Trace.String("StdIOShell: Exit"); Trace.Ln;
-		END;
-		Modules.Shutdown(code);
-		done := TRUE
+		done := TRUE;
 	END Executor;
 	END Executor;
 
 
 VAR execute: Executor;
 VAR execute: Executor;
 
 
 (* do not add commands here -- the module loader does not finish here and they will not become available *)
 (* do not add commands here -- the module loader does not finish here and they will not become available *)
 BEGIN	
 BEGIN	
-	NEW(execute); (* execute shell and termination in separate thread *)
-	execute.Wait; (* will actually never return *)
+	NEW(execute);
+	execute.Wait;
+	IF Verbose THEN Trace.String("StdIOShell: Exit"); Trace.Ln END;
+	Modules.Shutdown(execute.code);
 END StdIOShell.
 END StdIOShell.
 
 
 Linking a command line shell:
 Linking a command line shell: