summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/fpmkunit/src/fpmkunit.pp15
-rw-r--r--packages/fppkg/src/pkgdownload.pp2
2 files changed, 16 insertions, 1 deletions
diff --git a/packages/fpmkunit/src/fpmkunit.pp b/packages/fpmkunit/src/fpmkunit.pp
index c8e029f17d..35b5fb61c9 100644
--- a/packages/fpmkunit/src/fpmkunit.pp
+++ b/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;
diff --git a/packages/fppkg/src/pkgdownload.pp b/packages/fppkg/src/pkgdownload.pp
index 90634c0de2..321256d434 100644
--- a/packages/fppkg/src/pkgdownload.pp
+++ b/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)