Explorar o código

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 %!s(int64=7) %!d(string=hai) anos
pai
achega
78fd1f309e
Modificáronse 1 ficheiros con 6 adicións e 8 borrados
  1. 6 8
      source/StdIOShell.Mod

+ 6 - 8
source/StdIOShell.Mod

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