浏览代码

Added proper check for existing parent process before attempting to inherit its context

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8589 8c9fc860-2736-0410-a75d-ab315db34111
negelef 6 年之前
父节点
当前提交
86f43dc597
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      source/BIOS.Objects.Mod

+ 3 - 1
source/BIOS.Objects.Mod

@@ -1235,7 +1235,9 @@ BEGIN
 	NewProcess(body, flags, obj, t);
 	Machine.Acquire(Machine.Objects);
 	t.id := nextProcessID; INC(nextProcessID);
-	t.context := CurrentContext();
+	IF ~Machine.WorkingOnKernelStack () THEN
+		t.context := CurrentContext();
+	END;
 	IF priority = 0 THEN	(* no priority specified *)
 		t.priority := running[Machine.ID ()].priority (* inherit priority of creator *)
 	ELSIF priority > 0 THEN (* positive priority specified *)