diff options
author | marco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2017-06-21 18:37:22 +0000 |
---|---|---|
committer | marco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2017-06-21 18:37:22 +0000 |
commit | af59388ecccd0aa058c1e4f76db9d5e83f12b912 (patch) | |
tree | e2e41bcafad841f794e4a3695abfc71c5873fc4e | |
parent | aba264c5d8fc25a92eb08e17cc2715b98f883326 (diff) | |
download | fpc-af59388ecccd0aa058c1e4f76db9d5e83f12b912.tar.gz |
--- 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: https://svn.freepascal.org/svn/fpc/branches/fixes_3_0@36562 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | packages/fpmkunit/src/fpmkunit.pp | 15 | ||||
-rw-r--r-- | packages/fppkg/src/pkgdownload.pp | 2 |
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) |