瀏覽代碼

* added missing write memory barriers

git-svn-id: trunk@44788 -
Jonas Maebe 5 年之前
父節點
當前提交
2355daf63f
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      packages/fpmkunit/src/fpmkunit.pp

+ 6 - 4
packages/fpmkunit/src/fpmkunit.pp

@@ -3181,8 +3181,8 @@ begin
     RTLeventWaitFor(FNotifyStartTask,500);
     if not FDone then
       begin
-      { synchronise with WriteBarrier in mainthread for same reason as above }
-      ReadBarrier;
+      { synchronise with ReadWriteBarrier in mainthread for same reason as above }
+      ReadWriteBarrier;
       FBuildEngine.log(vlInfo,'Compiling: '+APackage.Name);
       FCompilationOK:=false;
       try
@@ -8182,8 +8182,10 @@ Var
   begin
     if AThread.Done then
       begin
-        { synchronise with the WriteBarrier in the thread }
-        ReadBarrier;
+        { synchronise with the WriteBarrier in the thread (-> ReadBarrier), and prevent
+          any writes we do here afterwards to be reordered before that (so the compile
+          thread won't see these writes either -> also WriteBarrier) }
+        ReadWriteBarrier;
         if assigned(AThread.APackage) then
           begin
             // The thread has completed compiling the package