浏览代码

Thread safety of Gfx !

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

+ 4 - 4
source/GfxRegions.Mod

@@ -357,7 +357,7 @@ MODULE GfxRegions; (** portable *)	(* eos  *)
 	(* merge two runs of data points *)
 	(* merge two runs of data points *)
 	PROCEDURE Merge (reg: Region; split: LONGINT);
 	PROCEDURE Merge (reg: Region; split: LONGINT);
 		VAR data: RegionData; n, N, m, M, p, tmp: LONGINT; nu, nv, ndir, mu, mv, mdir, sum, u, v, inc, nsum: INTEGER;
 		VAR data: RegionData; n, N, m, M, p, tmp: LONGINT; nu, nv, ndir, mu, mv, mdir, sum, u, v, inc, nsum: INTEGER;
-	BEGIN
+	BEGIN{EXCLUSIVE}
 		data := reg.data;
 		data := reg.data;
 		n := 0; N := split;
 		n := 0; N := split;
 		Decode(data[n], nu, nv, ndir);
 		Decode(data[n], nu, nv, ndir);
@@ -1014,7 +1014,7 @@ MODULE GfxRegions; (** portable *)	(* eos  *)
 
 
 	(** add rectangle to region **)
 	(** add rectangle to region **)
 	PROCEDURE AddRect* (reg: Region; llx, lly, urx, ury: INTEGER);
 	PROCEDURE AddRect* (reg: Region; llx, lly, urx, ury: INTEGER);
-	BEGIN
+	BEGIN{EXCLUSIVE}
 		SetToRect(RectRegion, llx, lly, urx, ury);
 		SetToRect(RectRegion, llx, lly, urx, ury);
 		Add(reg, RectRegion)
 		Add(reg, RectRegion)
 	END AddRect;
 	END AddRect;
@@ -1080,7 +1080,7 @@ MODULE GfxRegions; (** portable *)	(* eos  *)
 
 
 	(** subtract rectangle from region **)
 	(** subtract rectangle from region **)
 	PROCEDURE SubtractRect* (reg: Region; llx, lly, urx, ury: INTEGER);
 	PROCEDURE SubtractRect* (reg: Region; llx, lly, urx, ury: INTEGER);
-	BEGIN
+	BEGIN{EXCLUSIVE}
 		SetToRect(RectRegion, llx, lly, urx, ury);
 		SetToRect(RectRegion, llx, lly, urx, ury);
 		Subtract(reg, RectRegion)
 		Subtract(reg, RectRegion)
 	END SubtractRect;
 	END SubtractRect;
@@ -1176,7 +1176,7 @@ MODULE GfxRegions; (** portable *)	(* eos  *)
 
 
 	(** intersect region with rectangle **)
 	(** intersect region with rectangle **)
 	PROCEDURE IntersectRect* (reg: Region; llx, lly, urx, ury: INTEGER);
 	PROCEDURE IntersectRect* (reg: Region; llx, lly, urx, ury: INTEGER);
-	BEGIN
+	BEGIN{EXCLUSIVE}
 		SetToRect(RectRegion, llx, lly, urx, ury);
 		SetToRect(RectRegion, llx, lly, urx, ury);
 		Intersect(reg, RectRegion)
 		Intersect(reg, RectRegion)
 	END IntersectRect;
 	END IntersectRect;