Browse Source

--- Merging r34401 into '.':
U packages/fpmkunit/src/fpmkunit.pp
--- Recording mergeinfo for merge of r34401 into '.':
U .
--- Merging r34403 into '.':
G packages/fpmkunit/src/fpmkunit.pp
--- Recording mergeinfo for merge of r34403 into '.':
G .
--- Merging r36529 into '.':
U packages/fppkg/src/pkgdownload.pp
--- Recording mergeinfo for merge of r36529 into '.':
G .

# revisions: 34401,34403,36529

git-svn-id: branches/fixes_3_0@36562 -

marco 8 years ago
parent
commit
2f882e4dd0
2 changed files with 16 additions and 1 deletions
  1. 15 0
      packages/fpmkunit/src/fpmkunit.pp
  2. 1 1
      packages/fppkg/src/pkgdownload.pp

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

@@ -2799,11 +2799,19 @@ procedure TCompileWorkerThread.execute;
 begin
   while not Terminated do
     begin
+    { Make sure all of our results are committed before we set (F)Done to true.
+      While RTLeventSetEvent implies a barrier, once the main thread is notified
+      it will walk over all threads and look for those that have Done=true -> it
+      can look at a thread between that thread setting FDone to true and it
+      calling RTLEventSetEvent }
+    WriteBarrier;
     FDone:=true;
     RTLeventSetEvent(FNotifyMainThreadEvent);
     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
@@ -7419,6 +7427,8 @@ Var
   begin
     if AThread.Done then
       begin
+        { synchronise with the WriteBarrier in the thread }
+        ReadBarrier;
         if assigned(AThread.APackage) then
           begin
             // The thread has completed compiling the package
@@ -7450,6 +7460,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;

+ 1 - 1
packages/fppkg/src/pkgdownload.pp

@@ -148,7 +148,7 @@ begin
   P:=URI.Protocol;
   If CompareText(P,'ftp')=0 then
     FTPDownload(URL,Dest)
-  else if CompareText(P,'http')=0 then
+  else if (CompareText(P,'http')=0) or (CompareText(P,'https')=0) then
     HTTPDownload(URL,Dest)
   else if CompareText(P,'file')=0 then
     FileDownload(URL,Dest)