标准线程用法
Type
TAnalyzedataThread = class(TThread)
private
procedure DoProcedure;
protected
procedure Execute; override;
public
Constructor Create(CreateSuspended : boolean);
end;
constructor TAnalyzedataThread.Create(CreateSuspended : boolean);
begin
FreeOnTerminate := True;
inherited Create(CreateSuspended);
end;
procedure TAnalyzedataThread.DoProcedure;
begin
//Memo1.Lines.Add(IntToStr(SRList.Count));
Terminate();
end;
procedure TAnalyzedataThread.Execute;
begin
while (not Terminated) do
begin
Synchronize(@DoProcedure);
end;
end;
var
AnalyzedataThread:TAnalyzedataThread; //分析数据线程,一直在跑
调用方法
AnalyzedataThread:=TAnalyzedataThread.Create(True);
AnalyzedataThread.Resume;
匿名线程
TThread.CreateAnonymousThread(@ReceiveThread).Start;
加入windows后,所有线程用法也DELPHI一致
标签:begin,end,Create,lazarus,线程,TAnalyzedataThread,procedure From: https://www.cnblogs.com/dylxpecho/p/18295323