Pārlūkot izejas kodu

* also synchronise the data sent from the main thread to the worker threads,
as this can also be read by worker threads before any RTLEvent* has taken
place

git-svn-id: trunk@34403 -

Jonas Maebe 9 gadi atpakaļ
vecāks
revīzija
565288bef0
1 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. 7 0
      packages/fpmkunit/src/fpmkunit.pp

+ 7 - 0
packages/fpmkunit/src/fpmkunit.pp

@@ -2843,6 +2843,8 @@ begin
     RTLeventWaitFor(FNotifyStartTask,500);
     if not FDone then
       begin
+      { synchronise with WriteBarrier in mainthread for same reason as above }
+      ReadBarrier;
       FBuildEngine.log(vlInfo,'Compiling: '+APackage.Name);
       FCompilationOK:=false;
       try
@@ -7525,6 +7527,11 @@ Var
           // Instruct thread to compile package
           AThread.APackage := CompilePackage;
           AThread.APackage.FProcessing := true;
+          { Commit changes before setting FDone to false, because the threads
+            only wait for an event 500ms at a time and hence way wake up
+            and see that FDone=false before the event is sent and the changes
+            are all committed by the event code }
+          WriteBarrier;
           AThread.FDone:=False;
           RTLeventSetEvent(AThread.NotifyStartTask);
           end;