From 93f2bd48ddb54550f2369b28af6823ab72f35d29 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 23 Feb 2022 13:39:57 +0100 Subject: [PATCH] fcl-base: fixed compile fpthreadpool with fpc 3.2.2 --- packages/fcl-base/src/fpthreadpool.pp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/fcl-base/src/fpthreadpool.pp b/packages/fcl-base/src/fpthreadpool.pp index 59cfb94513..2f53acdf70 100644 --- a/packages/fcl-base/src/fpthreadpool.pp +++ b/packages/fcl-base/src/fpthreadpool.pp @@ -135,6 +135,9 @@ Type procedure TerminatedSet; override; procedure DoSetTask(AValue: TThreadPoolTask); virtual; Public + {$IF FPC_FULLVERSION<30300} + procedure Terminate; + {$ENDIF} Procedure FreeTask; Property Task : TThreadPoolTask Read FTask Write SetTask; end; @@ -308,6 +311,7 @@ Procedure DoLog(Const Fmt : String; Const Args : Array of const); begin DoLog(Format(Fmt,Args)) end; + {$ENDIF} { TFPCustomSimpleThreadPool.TAbstractThreadList } @@ -317,7 +321,6 @@ begin FPool:=aPool; end; - { TFPCustomSimpleThreadPool.TAutoCheckQueueThread } constructor TFPCustomSimpleThreadPool.TAutoCheckQueueThread.Create(aPool: TFPCustomSimpleThreadPool; aInterval: Integer); @@ -557,6 +560,14 @@ begin FTask:=AValue; end; +{$IF FPC_FULLVERSION<30300} +procedure TFPCustomSimpleThreadPool.TAbstractTaskThread.Terminate; +begin + inherited Terminate; + TerminatedSet; +end; +{$ENDIF} + procedure TFPCustomSimpleThreadPool.TAbstractTaskThread.FreeTask; begin FreeAndNil(FTask); @@ -566,7 +577,6 @@ procedure TFPCustomSimpleThreadPool.TAbstractTaskThread.TerminatedSet; begin if Assigned(FTask) then FTask.Terminate; - inherited TerminatedSet; end; { TThreadPoolTask } @@ -610,7 +620,6 @@ procedure TThreadPoolTask.Execute; Var RunOK : Boolean; - S : String; begin RunOK:=False; @@ -795,11 +804,9 @@ function TFPCustomSimpleThreadPool.DoAddTask(aTask: TThreadPoolTask) : Boolean; Var T : TAbstractTaskThread; - WaitStart : TDateTime; TimeOut : Boolean; begin - WaitStart:=0; Result:=False; TimeOut:=False; Repeat